String functions deal with modification, computation, and extraction operations on string columns. Let's look into a few commonly used functions:
- concat(string1, ..., stringN): This function is used to concatenate multiple string into a single string: select concat('packt','publication') as concat_value;.
- length(string): This function returns the length of a string.
- lower(string): This function converts a string to lowercase, which means that lowercase('CHINA') would return CHINA.
- ltrim(string): This function removes any leading whitespace from a string.
- rtrim(string): This function removes trailing whitespace from a string.
- replace(sourcestring, search): This function removes all instances of a search string from a string. ...