A Cheat Sheet containing the VBScript string functions and their equivalent methods in C#.
|InStr||Returns the position of the first occurrence of one string within another. The search begins at the first character of the string||IndexOf()|
|InStrRev||Returns the position of the first occurrence of one string within another. The search begins at the last character of the string||-|
|LCase||Converts a specified string to lowercase||ToLower()|
|Left||Returns a specified number of characters from the left side of a string||SubString()|
|Len||Returns the number of characters in a string||Length()|
|LTrim||Removes spaces on the left side of a string||TrimStart()|
|RTrim||Removes spaces on the right side of a string||TrimEnd()|
|Trim||Removes spaces on both the left and the right side of a string||Trim()|
|Mid||Returns a specified number of characters from a string||SubString()|
|Replace||Replaces a specified part of a string with another string a specified number of times||Replace()|
|Right||Returns a specified number of characters from the right side of a string||SubString()|
|Space||Returns a string that consists of a specified number of spaces||PadLeft(), PadRight()|
|StrComp||Compares two strings and returns a value that represents the result of the comparison||Compare(), Equals()|
|String||Returns a string that contains a repeating character of a specified length||-|
|StrReverse||Reverses a string||-|
|UCase||Converts a specified string to uppercase||ToUpper()|
Monday, May 28, 2007 9:18 PM
Last Updated: Monday, August 23, 2010 9:22 AM
Posted by: Mikesdotnetting
Total Views to date: 18971
Unfortunately, something went wrong and your message or comments have not been submitted successfully. I'll try to fix whatever the problem is as soon as I can.
Thanks for you comments. They have been successfully sent to me. I will try to respond if necessary as soon as I can.