VBS TUTORIAL: Functions-ltrim, RTrim, and Trim functions _vbs

Source: Internet
Author: User
Tags rtrim trim

LTrim, RTrim and Trim functions

Returns a copy of a string without leading spaces (LTrim), subsequent spaces (RTrim), or leading and trailing spaces (Trim).

LTrim(string)

RTrim(string)

Trim(string)

The string argument is any valid string expression. If NULL is included in the string argument, nullis returned.

Description

The following example uses the LTrim, RTrim, and Trim functions to remove spaces, trailing spaces, start, and trailing spaces at the beginning of a string, respectively:

LTrim(" vbscript ") 'MyVar Contains  "vbscript " . RTrim(" vbscript ") 'MyVar contains  "  vbscript" . Trim(" vbscript ") 'MyVar contains "vbscript" .

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.