String operation functions of asp

Source: Internet
Author: User

String function example of asp
Use string functions to intercept, remove, and replace uppercase and lowercase strings.

Function Syntax Function
Len Len (string | varname) Returns the number of characters in a string or the number of bytes required to store a variable.
Trim Trim (string) Remove spaces before and after the string
Ltrim Ltrim (string) Remove spaces before the string
Rtrim Rtrim (string) Remove spaces after the string
Mid Mid (string, start, length) Obtains the length string starting from the start character of the string. If the third parameter is omitted, it indicates the string starting from the start character to the end of the string.
Left Left (string, length) Obtains the length string from the left of the string.
Right Right (string, length) Obtains the length string from the right of the string.
LCase LCase (string) Converts all uppercase letters in a string to lowercase letters.
UCase UCase (string) Converts all uppercase letters in a string to uppercase letters.
StrComp StrComp (string1, string2 [, compare]) Returns the comparison result between the string1 string and the string2 string. If the two strings are the same, 0 is returned. If the value is smaller than 1,-1 is returned. If the value is greater than 1, 1 is returned.
InStr InStr (string1, string2[, compare]) Returns the position where the string1 string first appears in the string2 string.
Split Split (string1, delimiter[, count[, start]])

Splits a string into one-dimensional arrays based on delimiter. delimiter is used to identify the substring boundary. If omitted, use space ("") as the separator.
Count returns the number of substrings.-1 indicates that all substrings are returned.
Start is 1. If it is 0, or the binary comparison is omitted.

Replace Replace(expression, find, replacewith[, compare[, count[, start]]]) Returns a string, where a specified number of substring (find) is replaced with another substring (replacewith ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.