VBScript – String Functions


Tour : VBScript – String Functions

Step 1. VBScript – String Functions Introduction
Step 2. InStr function
Step 3. InStrRev function
Step 4. LCase function
Step 5. Left function
Step 6. Len function
Step 7. LTrim function
Step 8. RTrim function
Step 9. Trim function
Step 10. Mid function
Step 11. Replace function
Step 12. Right function
Step 13. Space function
Step 14. StrComp function
Step 15. String function
Step 16. StrReverse function
Step 17. UCase function
Step 18. Visit GoLearningBus.Com for more ” training

1. VBScript – String Functions Introduction
Same as other Programing Languages VBScript also have string functions to process strings.
VBScript support the Following string function : –

1) InStr
2) InStrRev
3) LCase
4) Left
5) Len
6) LTrim
7) RTrim
8) Trim
9) Mid
10) Replace
11) Right
12) Space
13) StrComp
14) String
15) StrReverse
16) UCase

2. InStr function
The InStr function Returns the position of the first occurrence of one string within another. The search begins at the first character of the string.

Syntax : InStr()..For more please read the given comments.

3. InStrRev function
The InStrRev function Returns the position of the first occurrence of one string within another. The search begins at the last character of the string.

Syntax : InStrRev(string1,string2)For more please read the given comments.

4. LCase function
The LCase function Converts a specified string to lowercase.

Syntax : LCase(string)

5. Left function
The Left function Returns a specified number of characters from the left side of a string.

Syntax : Left(string,length)

1) string :- Required. The string to return characters from
2) length :- Required. Specifies how many characters to return. If set to 0, an empty string (””) is returned. If set to greater than or equal to the length of the string, the entire string is returned

6. Len function
The Len function Returns the number of characters in a string.

Syntax : Len(string).

string : A string expression

7. LTrim function
The LTrim function removes spaces on the left side of a string.

Syntax : LTrim(string)

8. RTrim function
The RTrim function removes spaces on the right side of a string.

Syntax : RTrim(string)

9. Trim function
The Trim function removes spaces on both sides of a string.

Syntax : Trim(string)

10. Mid function
The Mid function returns a specified number of characters from a string.

Syntax : Mid(string,start)

1) string : Required. The string expression from which characters are returned
2) start : Required. Specifies the starting position. If set to greater than the number of characters in string, it returns an empty string (””)
3) length : Optional. The number of characters to return

11. Replace function
The Replaces function Replaces a specified part of a string with another string a specified number of times.

Syntax : Replace(string,find,replacewith)For more detail please read the comments that is shown here.

12. Right function
The Right function returns a specified number of characters from the right side of a string.

Syntax : Right(string,length)

1) string : Required. The string to return characters from
2) length : Required. Specifies how many characters to return. If set to 0, an empty string (””) is returned. If set to greater than or equal to the length of the string, the entire string is returned.

13. Space function
The Space function returns a string that consists of a specified number of spaces.

Syntax : Space(number)

14. StrComp function
The StrComp function compares two strings and returns a value that represents the result of the comparison.
Syntax : StrComp(string1,string2)For more detail please read the comments that is shown here.

15. String function
The String function Returns a string that contains a repeating character of a specified length.

Syntax : String(number,character)

1) number :- Required. The length of the returned string
2) character :- Required. The character that will be repeated

16. StrReverse function
The StrReverse function Reverses a string.

Syntax : StrReverse(string)

17. UCase function
The UCase function Converts a specified string to uppercase.

Syntax : UCase(string)

18. Visit GoLearningBus.Com for more ” training
Visit GoLearningBus.Com for more ” guided tours and training.
For only you can access more than 300 apps for a lifetime of learning and training.