VBScript: More String Functions (Page 1 of 6 )
In our previous article we left off discussing a few of the string functions in VBScript. We didn’t get very far; of the sixteen available to us, we only covered four. As you will recall, they were the InStr and InStrRev, which let us check to see if a particular character or string was within another string, and the UCase and LCase functions, which let us format a given string to all uppercase or lowercase letters.
We will pick up in this article by previewing the string functions table, and then dive right into the Left, Right, and Mid functions. So strap on your army boots, assemble your rifles, and get ready to kiss the mud. Your left, your left, your left, right, left, now do the hustle.
Function | What It Does |
InStr | Used to return the position of the first occurrence of a string within another string. |
InStrRev | Same as InStr only it begins searching from the last character of the string. |
LCase | Takes a string and converts it to lowercase. |
UCase | Takes a string and converts it to uppercase. |
Left | Used to return a number of characters you specify from the left side of a string. |
Right | Used to return a number of characters you specify from the right side of a string. |
Mid | Used to return a number of characters you specify from a string. |
Len | Used to return the number of characters in a string. |
LTrim | Used to remove spaces from the left side of a string. |
RTrim | Used to remove spaces from the right side of a string. |
Trim | Used to remove spaces from both the left and right side of a string. |
Replace | Used to replace a part of a string with another string a number of times you specify. |
Space | Used to return a string made up of a number of spaces you specify. |
StrComp | Used to compare two strings. Returns a value representing the results. |
StrReverse | Used to reverse a string. |
String | Used to return a string that repeats a character a number of times you specify. |
Next: Left Behind >>
More Windows Scripting Articles
More By James Payne