There will come a time when you need to dice up a string which is all one word or a number. In this particular case, Split() won't work for you. What we will discuss here is Left() Mid() and Right().
Left Mid Right
Learn to use Left() Right() Mid() functions using asp with vbscript with this tutorial
True Type Fonts
Download thousands of free fonts.
Download Here.
Device Drivers
DirectX
VBrun Files
By Peripheral:


All Drivers
Dll Search
Download Dll Files
Enter The Dll Name:
Paco's Screensaver
Download The Official Paco's Drivers Screensaver.
Check It Out
Computer Maintenance
File Systems
Hardware
Over Clocking
Registry
Surf 2X Faster
Desktop Enhancements
Anime
Icons
Screensavers
Themes
Site Search:

Free Software
Anti-Virus
Audio Tools
E-Mail Clients
Firewalls
Graphic Editors
Web Development
ASP/VBScript
CGI Script
HTML
JavaScript
Paco's Own Scripts
Webmasters Tools
Were Listed @

Aspin.com

ScriptSearch.com

Left() Mid() Right()

Let's take the word oil to begin with. Now assume you only want the first letter, o.
Here's how we will do this.
<%
Dim strWord, strLetter

strWord = "oil"

strLetter = Left(strWord,1)

Response.Write strLetter
%>

What we just did was told the server to take the word oil, start from the left and get the letter in the first place.
This will print: o

Now lets say you just want the last letter, l.
<%
Dim strWord, strLetter

strWord = "oil"

strLetter = Right(strWord,1)

Response.Write strLetter
%>
What we just did was told the server to take the word oil, start from the right and get the letter in the first place.
This will print: l

Now we want the letter i. Mid comes into play now.
<%
Dim strWord, strLetter

strWord = "oil"

strLetter = Mid(strWord,2,1)

Response.Write strLetter
%>
We added a number here. What we just did was told the server to take the word oil, start from the second letter in the word, and display one letter.
This will print: i

But, what if the word is not 3 letters long? Let's look at a longer word like server.
<%
Dim strWord, strLetter

strWord = "server"

strLetter = Mid(strWord,4,1)

Response.Write strLetter
%>
What we just did was told the server to take the word server, start from the fourth letter in the word, and display one letter.
This will print: v

If you want more than 1 letter change the number like so:
<%
Dim strWord, strLetter

strWord = "server"

strLetter = Mid(strWord,4,3)

Response.Write strLetter
%>
What we just did was told the server to take the word server, start from the fourth letter in the word, and display one letter.
This will print: ver

There you have it, Left() Mid() and Right() all wrapped up nice and neat.


Search The Web Using Paco's MetaSearch
  
any   all   phrase
 About  Factmonster  AlltheWeb   
 MSN  Yahooligans      
Arts
Movies, Television, Music...
Business
Jobs, Industries, Investing...
Computers
Internet, Software, Hardware...
Games
Video Games, RPGs, Gambling...
Health
Fitness, Medicine, Alternative...
Home
Family, Consumers, Cooking...
Kids and Teens
Arts, School Time, Teen Life...
News
Media, Newspapers, Weather...
Recreation
Travel, Food, Outdoors, Humor...
Reference
Maps, Education, Libraries...
Regional
US, Canada, UK, Europe...
Science
Biology, Psychology, Physics...
Shopping
Autos, Clothing, Gifts...
Society
People, Religion, Issues...
Sports
Baseball, Soccer, Basketball...
World
Deutsch, Español, Français, Italiano, Japanese, Nederlands, Polska, Svenska...
Help build the largest human-edited directory of the web
Stop Popups
Paco's Popup Plucker.
Eliminate those pesky popups!
Users Online
Currently 78 users at PacosDrivers.com
Paco's Online

Send this page to a friend
Report Broken Links
Bad or missing query parameters in request.
Hosted By
ChamberGates

Privacy Policy
Best Viewed At 1024 X 768 Or Higher
Copyright © 2000-2008 Pacosdrivers.com. All Rights Reserved.