Expand description

Unicode expressions

Functions§

  • Returns a value in the range of 1 to N if the string str is in the string list strlist consisting of N substrings A string list is a string composed of substrings separated by , characters.
  • Returns first n characters in the string, or when n is negative, returns all but last |n| characters. left(‘abcde’, 2) = ‘ab’ The implementation uses UTF-8 code points as characters
  • Extends the string to length ‘length’ by prepending the characters fill (a space by default). If the string is already longer than length then it is truncated (on the right). lpad(‘hi’, 5, ‘xy’) = ‘xyxhi’
  • Reverses the order of the characters in the string. reverse(‘abcde’) = ‘edcba’ The implementation uses UTF-8 code points as characters
  • Returns last n characters in the string, or when n is negative, returns all but first |n| characters. right(‘abcde’, 2) = ‘de’ The implementation uses UTF-8 code points as characters
  • Extends the string to length ‘length’ by appending the characters fill (a space by default). If the string is already longer than length then it is truncated. rpad(‘hi’, 5, ‘xy’) = ‘hixyx’
  • Returns starting index of specified substring within string, or zero if it’s not present. (Same as position(substring in string), but note the reversed argument order.) strpos(‘high’, ‘ig’) = 2 The implementation uses UTF-8 code points as characters
  • Extracts the substring of string starting at the start’th character, and extending for count characters if that is specified. (Same as substring(string from start for count).) substr(‘alphabet’, 3) = ‘phabet’ substr(‘alphabet’, 3, 2) = ‘ph’ The implementation uses UTF-8 code points as characters
  • Returns the substring from str before count occurrences of the delimiter delim. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter (counting from the right) is returned. SUBSTRING_INDEX(‘www.apache.org’, ‘.’, 1) = www SUBSTRING_INDEX(‘www.apache.org’, ‘.’, 2) = www.apache SUBSTRING_INDEX(‘www.apache.org’, ‘.’, -2) = apache.org SUBSTRING_INDEX(‘www.apache.org’, ‘.’, -1) = org
  • Replaces each character in string that matches a character in the from set with the corresponding character in the to set. If from is longer than to, occurrences of the extra characters in from are deleted. translate(‘12345’, ‘143’, ‘ax’) = ‘a2x5’