Scalar. Returns a specified number of characters from the beginning of a given string.
left ( string, count )
string | A string. |
count | The number of characters to return. |
Returns a specified number of characters from the beginning of a given string. The function takes a string and an integer as the count argument. The function returns a string. If count is a negative number, the function returns NULL. If count is 0, the function returns an empty string.
The function works with UTF-8 strings if the -U server option is specified.
left ('examplestring', 7) returns 'example'.