We introduce the concept of associativity for string functions, where a string function is a unary operation on the set of strings over a given alphabet. We discuss this new property and describe certain classes of associative string functions. We also characterize the recently introduced preassociative functions as compositions of associative string functions with injective unary maps. Finally, we provide descriptions of the classes of associative and preassociative functions which depend only on the length of the input.