Implement several functions for string operations.