C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

String Functions


Posted Date: 06 Nov 2009    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: DeviPriyaaMember Level: Silver    
Rating: 1 out of 5Points: 4



String Functions in ASP.NET

Asc() ? Returns the character code of the first character of a string.
Asc("A") returns 65.
Chr() ?Returns the display character of a character code.
Chr(65) returns "A".
GetChar()? Returns the char at a specified posi in a string, counting from 1.
GetChar("This is a string", 7) returns "s".
InStr() ?Returns the starting position in a string of a substring, counting from 1.
InStr("This is a string", "string") returns 11.
InStrRev() ? Returns the starting position in a string of a substring, searching from the end of the string.
LCase() ? Returns the lower-case conversion of a string.
LCase("THIS IS A STRING") returns "this is a string".
Left() ? Returns the left-most specified number of characters of a string.
Left("This is a string", 4) returns "This".
Len() ? Returns the length of a string.
Len("This is a string") returns 16.
LTrim() ? Removes any leading spaces from a string.
Mid() ?Returns a substring from a string, specified as the starting position (counting from 1) and the number of characters.
Mid("This is a string", 6, 4) returns "is a".
Replace()? Replaces all occurences of a substring in a string.
Replace("This is a string", " s", " longer s") returns "This are a longer string"
(replaces an "s" preceded by a blank space).
Right() ?Returns the right-most specified number of characters of a string.
Right("This is a string", 6) returns "string".
RTrim() ? Removes any trailing spaces from a string.
Str() ? Returns the string equivalent of a number.
Str(100) returns "100".
Space() ? Fills a string with a given number of spaces.
"This" & Space(5) & "string" returns "This string".
StrComp() ? Compares two strings. Return values are 0 (strings are equal), 1
(first string has the greater value), or -1 (second string has the greater . value) based on sorting sequence
StrComp("This is a string", "This string") returns -1.
StrReverse() ? Reverses the characters in a string.
StrReverse("This is a string") returns "gnirts a si sihT".
Trim() ?Removes any leading and trailing spaces from a string.
UCase() ?Returns the upper-case conversion of a string.
UCase("This is a string") returns "THIS IS A STRING".
Val()? Converts a numeric expression to a number.
Val( (1 + 2 + 3)^2 ) returns 36.



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
String Functions in asp.net  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: IIS-7 New Future
Previous Resource: Selecting multiple records from a listbox / checkbox list / radio button list
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use