ASP Delete all space functions for strings

Source: Internet
Author: User
Tags rtrim sql injection trim

In our programming, we often touch the space to remove the string, since the site to achieve a step closer to security, anti-SQL injection, etc., in the ASP tutorial we will mainly use Trim,ltrim,rtrim these three functions to example

Trim, while deleting the space before or after the string without deleting the middle space as an instance

Dim txttxt= "Www.3lian.netis A beautiful day! "
document.write (Trim (TXT)) Gets the result for Www.3lian.net Isa beautiful day!

LTrim function is to remove the left space

Dim txttxt= "China Web first station address is www.3lian.netday! "
document.write (LTrim (TXT)) Results The first Chinese web site address is www.3lian.netday!

RTrim function, delete function on right

Dim txttxt= "ABC 3lian.net day! "
document.write (RTrim (TXT))//abc 3lian.net day!

Related Article

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.