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


 


InStr ASP String Function



InStr is a commonly used ASP function that allows you to determine where a character or characters falls within a string. This is much like the command loc or mid in other languages. It takes in 2 parameters:

* The string to operate on
* The character or characters to locate

The original string variable is not altered.

Let's say you have a string called UserName which is equal to "Lisa Shea". Now let's say you just want to know where the space falls in the username, so you can cut the string apart into the first name and last name at that point. You would use:

SpaceLoc = InStr(UserName, " ")

The result is that SpaceLoc would be equal to 5. You could then use that knowledge along with the total length of the string (found with the Len function) to use Left function and the Right function to chop up your string.

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 Del.icio.us 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 2013 Minerva WebWorks LLC. All rights reserved.

Irish Wedding

Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
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



affiliate_link