Left and Right VBScript functions

The Left Function

Syntax: Left(String, NumofCharactersToGetFromString)

The Function will return the number of characters you stipulate. As is obvious it starts from the left.

Example:

<%
String1="Michael"
response.write "The first 3 letters of my name are " & Left(String1,3)
%>

Output:
The first 3 letters of my name are Mic

The Right function

As you can imagine the right function does something very similar to the left function, though it starts from the right.

Example:

<%
String1="Michael"
response.write "The last 3 letters of my name are " & Right(String1,3)
%>

Output:
The last 3 letters of my name are ael



Other useful VBScript functions for Parsing String

Get the best asp hosting provider from web-hosting-top.com and save up to 30%

Advertisements



MembersPro

MembersPro PayPal - ASP Membership software

Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.

Global ASP.NET Hosting Leader - Click Here