String Functions

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 12:35, 15 February 2008 by Ccornell (Talk | contribs)

Jump to: navigation, search



OpenOffice.org Basic supports several runtime functions for string manipulation. Some of the functions are explained briefly in the following:

  • Asc returns the the Unicode value.
  • Chr returns a string containing the character that is specified by the ASCII or Unicode value passed to the function. This function is used to represent characters, such as '"' or the carriage return code (chr(13)) that can not be written in the "" notation.
  • Str converts a numeric expression to a string.
  • Val converts a string to a numeric value.
  • LCase converts all letters in a string to lowercase. Only uppercase letters within the string are converted. All lowercase letters and nonletter characters remain unchanged.
  • UCase converts characters in a string to uppercase. Only lowercase letters in a string are affected. Uppercase letters and all other characters remain unchanged.
  • Left returns the leftmost “n” characters of a string expression.
  • Mid returns the specified portion of a string expression.
  • Right returns the rightmost "n" characters of a string expression.
  • Trim removes all leading and trailing spaces of a string expression.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools