Summary of character and digit operation function in ASP

Source: Internet
Author: User
Tags comparison numeric numeric value range rtrim split trim valid

The CStr () is converted to a string, CInt () is converted to a number, and CLng () is converted to a Variant of a Long type

First, use the Isnumberic function to judge

Plastic...... Turn character: CStr () function

Character shaping with: CInt () function

Character shape: CLng () function

List of functions

CBool Boolean Any valid string or numeric expression.

CByte Byte 0 to 255.

CCur currency-922,337,203,685,477.5808 to 922,337,203,685,477.5807.

Any valid date expression for CDate date.

CDBL Double negative from -1.79769313486232E308 to -4.94065645841247E-324; positive numbers from 4.94065645841247E-324 to 1.79769313486232E308.

CDEC Decimal 0 Variable ratio, that is, no decimal digits, is +/-79,228,162,514,264,337,593,543,950,335. For a 28-bit decimal number, the range is +/-7.9228162514264337593543950335, and the smallest possible non-0 value is 0.0000000000000000000000000001.

CInt integer-32,768 to 32,767, fractional part rounded.

CLng long-2,147,483,648 to 2,147,483,647, fractional part rounded.

The CSng single negative number is -3.402823E38 to -1.401298E-45, and a positive number is 1.401298E-45 to 3.402823E38.

The CStr String returns CSTR based on the expression parameter.

If the CVar Variant is a numeric value, the range is the same as a Double, and if not a numeric value, the range is the same as a string.

Use String functions to truncate the string to the end, case substitution, and so on.

Len Len (string|varname) returns the number of characters within a string, or the number of bytes required to store a variable.

Trim Trim (string) to remove spaces before and after a string

Ltrim Ltrim (String) removes the space before the string

Rtrim Rtrim (String) to remove the space after the string

Mid mid (string,start,length) gets a length string from the start character of the string string, if the third argument is omitted to represent a string starting from the start character to the end of the string

Left string,length the length of a string from the left-hand side of a string string

Right-hand right (string,length) Gets the length of a string from the side of the string string

LCase LCase (String) converts all uppercase letters in string strings to lowercase letters

UCase UCase (String) converts all uppercase letters in string strings to uppercase letters

StrComp StrComp (String1,string2[,compare]) returns a comparison of string1 string and string2 string, if two strings are the same, returns 0 if less than 1, or 1 if greater than

InStr InStr (string1,string2[, compare]) returns the first occurrence of the string1 string in the string2 string

Split Split (string1,delimiter[, count[, start]) splits the string into a one-dimensional array based on delimiter, where delimiter is used to identify the substring bounds. If omitted, use a space ("") as the separator.

The number of substrings returned by count,-1 indicates that all substrings are returned.

Start is 1 to perform a text comparison, if 0 or omit to perform a binary comparison.

Replace replace (expression, find, replacewith[, compare[, count[, start]]) returns a string in which a specified number of substrings (find) is replaced with another substring ( replacewith).

Related Article

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.