Web Templates
Web Templates  
Photoshop Layouts  
Flash Templates  
Templates Resource - Web Templates
   
 
  Sign UpPassword
Templates Resource Services Support Specials Members View Cart
 
  Photoshop Tutorials
  HTML Tutorials
  ASP Tutorials
  CSS Tutorials
  Javascript Tutorials
  PHP Tutorials
  XML Tutorials
  Flash Tutorials
  Fireworks Tutorials
  3D Studio Max Tutorials
  Cinema 4d Tutorials
  Graphics
  Website Tools
  Web Templates
  About Templates Resource
  Affiliates Program
  TR Support
  Webmaster Resources
 Columbia Tech Support

WebDesignHelper.co.uk


 

Tutorials: ASP - Active Server Pages

String Functions

Beginner

This tutorial will teach you all of the basic string functions available in ASP using VBScript. I will keep things concise as possible. The following is a list of the functions and an example of each.

Asc();
Asc() will provide you with the ASCII character code of the character in the parentheses.

<%
str1 = Asc("B")
response.write str1
%>

cStr();
cSrt() will convert a numeric value into a string.

<%
int1 = 35
str1 = cStr(int1)
%>

inStr();
inStr() will locate the occurance of a character (or set of characters) in a string and output it's place.

<%
str1 = "ABCDEF"
str2 = inStr(str1,"BC")
response.write str2
%>

LCase();
LCase() will convert an entire string to lowercase.

<%
str1 = "ABCDEF"
str2 = LCase(str1)
response.write str2
%>

UCase();
UCase() will convert an entire string to uppercase.

<%
str1 = "abcdef"
str2 = UCase(str1)
response.write str2
%>

 

Trim();
Trim will remove all blank spaces from the beginning or end of a string.

<%
str1 = " ABCDEF"
str2 = Trim(str1)
response.write str2
%>

Len();
Len() will tell you the number of characters in a string.

<%
str1 = "ABCDEF"
str2 = Len(str1)
response.write str2
%>

Replace();
Replace() will replace a character (or set of characters) with another character (or set of characters).

<%
str1 = "ABCDEF"
str2 = Replace(str1,"CD","YZ")
response.write str2
%>

Split();
Split() will split a string into an array of values based on the character defined.

<%
str1 = "ABC,DEF"
str2 = Split(str1,",")
response.write str2(0)
response.write ""
response.write str2(1)
%>

Left();
Left() will retrieve the number of characters specified from the left of the string.

<%
str1 = "ABCDEF"
str2 = Left(str1,3)
response.write str2
%>

Right();
Right() will retrieve the number of characters specified from the right of the string.

<%
str1 = "ABCDEF"
str2 = Right(str1,3)
response.write str2
%>

Mid();
Mid() will retrieve the number of characters specified from the middle of the string.

<%
str1 = "ABCDEF"
str2 = Mid(str1,3,2)
response.write str2
%>

That's it! Have fun playing with strings.

 

This tutorial is provided to you by Spoono

More Tutorials
 

Active Server Pages Tutorials

AIM Screennames Viewer
This tutorial will show you how to make a script to see who has seen your AOL Instant Messenger profile.

Intermediate

Alternating Row Colors
Learn the basics of creating wonderfully abstract objects.

Intermediate

Browser Redirect
Learn how to do a Browser Redirect using the power of ASP.

Beginner

Cookies
Learn how to use cookies in ASP.

Intermediate

Counter
Learn how to make a hit counter in ASP.

Beginner

Database Connection
Learn the different ways to connect to different databases.

Intermediate

Database Insert
Learn how to insert a row into a MS Access database.

Beginner

Displaying Database
Learn a quick and easy way to display information from a database.

Beginner

Form Mail via CDONTS
Learn how to send mail using ASP and CDONTS

Intermediate

Form Mail via CDOSYS
Learn how to send mail using ASP and CDOSYS.

Intermediate

Number of Users Online
Use this code to display the number of users browsing.

Intermediate

Requests
Learn how to make use of requests.

Beginner

Sessions
Learn an alternative and effective solution to cookies in ASP using sessions.

Intermediate

String Functions
Learn the basic string functions available in ASP using VBScript

Beginner

XML Parsing
Use this nifty script to parse XML into HTML

Intermediate

Get help using .ASP here!

Get Free ASP Scripts here!

More Tutorials

Featured Web Templates

Web Template Preview 92300101

User Level:

advanced

Category:

flash


Web Template Preview 92300301

User Level:

Advanced

Category:

Flash



Web Template Preview 92300401

User Level:

Advanced

Category:

Flash


Web Template Preview 92300501

User Level:

Advanced

Category:

Flash


Web Template Preview 92300601

User Level:

Advanced

Category:

Flash


Web Template Preview 92300901

User Level:

Advanced

Category:

Flash


Web Template Preview 92301001

User Level:

Advanced

Category:

Flash


Web Template Preview 92301201

User Level:

Advanced

Category:

Flash


Web Template Preview 92301401

User Level:

Advanced

Category:

Flash



Web Template Preview 92301601

User Level:

Advanced

Category:

Flash

 

 

 

Templates Resource FAQ Services Terms of Use Site Map Support View Cart

© Copyright 2003-2008 Templates Resource