dcsimg
June 23, 2018
Hot Topics:

Advanced String Functions

  • November 19, 2002
  • By John Percival
  • Send Email »
  • More Articles »

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



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date