ascii()
chr()
ends_with()
index_of()
len()
lower()
ltrim()
mv_to_string()
number_to_string
replace()
rtrim()
starts_with()
string_to_number
substr()
trim()
upper()
Windowing Functions
coalesce
Previous Versions
Removes the specified substring from the beginning and the end of a string.
trim(string,substr)
This function removes substr from the beginning and end of string, then returns the result. To remove leading and trailing spaces, do not specify a value for substr.
1–- the resulting string in both cases is 'MyString';
2q = foreach q generate trim("abcMyStringabc","abc") as 'Trimmed String';
3q = foreach q generate trim(" MyString ") as 'Trimmed String';