ASP common functions (3)

xiaoxiao2021-03-06  109

Function: Returns the character (including Changth characters) before the string on the right side of the string.

SYNTAX: Right (String, Length)

Arguments:.

EXAMPLE: <%

strTest = "this is an test!"

Response.write Right (strTest, 3)

%>

Result: ST!

RND ()

Function: Generate a random number.

SYNTAX: RND [(Number)]

Arguments:

EXAMPLE: <%

Randomize ()

Response.write rnd ()

%>

Result: Number of any one between 0 and 1

Round ()

Function: Returns the value of the pointing number to the number.

Syntax: Round (Expression [, nuMright])

Arguments: NUMRIGHT number indicates how many counts in the right side of the decimal point. If omitted, then

The Round function returns an integer.

EXAMPLE: <%

i = 32.45678

Response.write Round (i)

%>

RESULT: 32

RTRIM ()

Function: Remove the string on the right side of the string.

SYNTAX: RTRIM (String)

Arguments:

EXAMPLE: <%

strTest = "this is a test !!"

Response.write Rtrim (StRTEST)

%>

Result: this is a test !!

SECOND ()

Function: Return second.

SYNTAX: Second (TIME)

Arguments:.

EXAMPLE: <% = second (# 12: 34: 28 pm #)%>

RESULT: 28

Strreverse ()

Function: a string

Syntax: Strreverse (String)

Arguments:

EXAMPLE: <%

strTest = "this is a test !!"

Response.Write Strreverse (StRTEST)

%>

Result: !! Tset A Si SIHT

Time ()

Function: Returns the system time.

Syntax: Time ()

Arguments:.

Example: <% = Time%>

Result: 9:58:28 AM

Trim ()

Function: Remove the space of the string.

Syntax: Trim (String)

Arguments: string is any valid string expression.

EXAMPLE: <%

strTest = "this is a test !!"

Response.write Trim (StRTEST)

%>

Result: this is a test !!

Ubound ()

Function: Returns the maximum subscript of the specified array dimension.

Syntax: ubound (arrayname [, dimension])

Arguments:; Dimension (optional) Specifies which one-dimensional upper boundary integer. 1 means the first

Dimension, 2 indicates the second dimension, and so on. If the Dimension parameter is omitted, the default value is 1.

EXAMPLE: <%

i = array ("Monday", "Tuesday", "Wednesday")

Response.write ubound (i)

%>

Result: 2UCase ()

Function: Returns the uppercase of the string.

Syntax: ucase (String)

Arguments:

EXAMPLE: <%

strTest = "this is a test !!"

Response.write ucase (StRTEST)

%>

Result: this is a test !!

VARTYPE ()

Function: Returns the value indicating the variable amount type

Syntax: VARTYPE (VarName)

Arguments:

EXAMPLE: <%

i = 3

Response.write Vartype (i)

%>

Result: 2 (Digital) See "ASP constant" for details

Weekday ()

Function: Returns on the first few days of the week.

Syntax: Weekday (Date [, Firstdayofwek])

Arguments:.

EXAMPLE: <%

D = # 8/4/99 #

Response.write weekday (d)

%>

Result: 4 (Wednesday)

WeekdayName ()

Function: Returns the name of the first day.

Syntax: weekdayname (weekday [, abb] [, firstdayofweek])

Arguments: ABB is optional. Boolean value indicates whether abbreviation represents the name of the day of the week. If the province

Slightly, the default is false, that is, the name of the day does not abrink the name of the day. Firstdayofweek indicates the first day of the week.

Numerical value

EXAMPLE: <%

D = # 8/4/99 #

Response.write weekdayname (Weekday (D))

%>

Result: Wednesday

Year ()

Function: Returns the current year.

Syntax: Year (Date)

Arguments:

EXAMPLE: <% = year (# 8/4/99 #)%>

RESULT: 1999

转载请注明原文地址:https://www.9cbs.com/read-124629.html

New Post(0)