early implementations of some of the string functions