Returns text that occurs before a given character or string