ASP Is Fun

Learning ASP
Free Course
Basics
Functions
SQL Commands
Sample Code

Servers / Setup
Host Reviews
Server Setup
Error Tips

Contract ASP
Development

Intro to ASP



 


Trim ASP String Function



Trim is a commonly used ASP function that allows you to quickly remove any extra spaces at the beginning or ending of a string. It takes in one parameter:

* The string variable to operate on

The original string variable is not altered.

This is pretty much a required thing to do to ANY field a user types in for you to use. Users are notorious for putting extra spaces at the beginning or end of their input.

Let's say your user puts in their name and you take this in as UserName. But say the user has poor typing skills and you now get:

UserName = " Lisa Shea "

with extra spaces. You would use

UserName = Trim(UserName)

To turn that into just "Lisa Shea" with no spaces. Note that it leaves any spaces WITHIN the string - between the Lisa and the Shea. It only removes extra spaces at the beginning or end.

ASP String Functions


ASP Main Page | ASP Ebooks | Free ASP Course | Contact Lisa
All content copyright © 2008 Minerva WebWorks LLC. All rights reserved.

custom wedding favors


Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
Members
Shopping


Introduction to ASP

Romance Tips
Irish Romance
Italian Romance
French Romance

ASP Poll
How do you handle 500 errors?
I don't
Page does nothing
Displays error
Emails error