| Manipulation of String:
InStr(), LCase(), Left(), Len(), LenB(), LTring(), Mid(), Replace(), Right(), RTrim(), Space (), String(), StrReverse(), Trim(), UCase() |
| LCase(string) and UCase(string) Changes to lower case or to upper case | ||
| TheString="AbCdEfGhIjKlMnOpQrStUvWxYz"
LCase: <% =LCase("AbCdEfGhIjKlMnOpQrStUvWxYz") %> UCase: <% =UCase("AbCdEfGhIjKlMnOpQrStUvWxYz") %> |
Original: AbCdEfGhIjKlMnOpQrStUvWxYz
LCase: abcdefghijklmnopqrstuvwxyz UCase: ABCDEFGHIJKLMNOPQRSTUVWXYZ |
|
| InStr(string, string1) Position of string1 within string. See also Compare strings | ||
| TheString="My cat is very nice"<% TheString="My cat is very nice"
%>
Location of cat within TheString?
very?
nice?
dog?
CAT?
|
String: "My cat is very nice"
cat?
very?
nice?
dog?
CAT?
|
|
| Len(string) and LenB(string) Length of string (number or character or bytes) | ||
| <pre>
Number of characters in a string Len("0123456789"): <% =Len("0123456789") %>
For numbers will indicate number of bytes required by store number Len (1): <% =Len(1) %>
Number of bytes to store a string LenB("0123456789"): <% =LenB("0123456789") %>
|
Number of characters in a string
Len("0123456789"): 10
For numbers will indicate number of bytes required by store number Len (1): 1
Number of bytes to store a string LenB("0123456789"): 20
|
|
| Replace(string,string1,string2) Replace string1 by string2 within string | ||
| <pre>
String: "My cat is very nice" Change "cat" to "dog"
|
String: "My cat is very nice"
Change "cat" to "dog"
|
|
| Right(string,number), Left(string,number), Mid(string,number,number) Obtains substrings from string | ||
| <pre>
Original: 1234567890 Right("1234567890",2): <% =Right ("1234567890",2) %>
Left("1234567890",2): <% =Left ("1234567890",2) %>
Mid("1234567890",5,1): <% =Mid("1234567890",5,1) %>
|
Original: 1234567890
Right("1234567890",2): 90
Left("1234567890",2): 12
Mid("1234567890",5,1): 5
|
|
| Space (number) Inserts spaces | ||
| <pre>
10: X<% =Space (10) %>X 15: X<% =Space (15) %>X 20: X<% =Space (20) %>X </pre> |
10: X X
15: X X 20: X X |
|
| String(number,string) Repeat the string the number of times indicated | ||
| <pre>
10: <% =String (10,"a") %> 15: <% =String (15,"a") %> 20: <% =String (20,"a") %> </pre> |
10: aaaaaaaaaa
15: aaaaaaaaaaaaaaa 20: aaaaaaaaaaaaaaaaaaaa |
|
| StrReverse(string) Reverse order of string | ||
| <pre>
Returns string with characters in reverse order StrReverse("0123456789"): <% =StrReverse("0123456789") %>
</pre> |
Returns string with characters in reverse order
StrReverse("0123456789"): 9876543210
|
|
| Trim(string), LTrim(string), RTrim(string) Eliminates spaces in the left, right or both sites | ||
| <pre>
Trim: X<% =Trim (" sss ") %>X LTrim: X<% =LTrim (" sss ") %>X RTrim: X<% =RTrim (" sss ") %>X </pre> |
Trim: XsssX
LTrim: Xsss X RTrim: X sssX |
|
2002@ AspTutorial.info.
All rights reserved.
Hosted by 1planhost.com ($99/year)
more partners