Advanced String Functions
Last week, we looked at the basic string functions, and some of their applications. This week, we will look at the more advanced string functions, and put them into use.
LTrim$, RTrim$, Trim$
These are the first functions that we will look at this week. They only just fall into the advanced category. They are used to remove preceding and trailing spaces from strings. For example:
mystring = " Hello! " LTrim$(mystring) contains "Hello! " Rtrim$(mystring) contains " Hello!" Trim$(mystring) contains "Hello!" It is equal to LTrim$(RTrim$(mystring))
This function is particularly useful for API functions, which often return strings with spaces preceding and trailing the string.
Syntax:
LTrim(string) RTrim(string) Trim(string)
Page 1 of 2
This article was originally published on November 20, 2002