ASP Is Fun

Learning ASP
Free ASP Course
ASP Basics
ASP Functions
SQL Commands
Sample ASP Code

Servers / Setup
ASP Host Reviews
ASP Server Setup
ASP Error Tips

Contract ASP
ASP Development

Search For:

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

Bookmark this site so you can reference it any time you have ASP questions in the future!

Add ASP+Functions+ to Twitter Add ASP+Functions+ to Facebook Add ASP+Functions+ to MySpace Add ASP+Functions+ to Digg ASP+Functions+ Add ASP+Functions+ to Yahoo My Web Add ASP+Functions+ to Google Bookmarks Add ASP+Functions+ to Stumbleupon Add ASP+Functions+ to Reddit


Get Emails when this Site is Updated

ASP Ebooks | Free ASP Course |
All content copyright 2014 Minerva WebWorks LLC. All rights reserved.

Italian Wedding

Free Newsletter!

Intro to ASP
ASP Members
ASP Shopping

Introduction to ASP

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