ASP Common Function 2

xiaoxiao2021-03-06  112

Function: Judging whether an object is initialized, return to the Boolean value.

SYNTAX: ISEMPTY (EXPRESSION)

Arguments:

EXAMPLE: <%

DIM I

Response.Write ISempty (i)

%>

Result: True

Isnull ()

Function: Judging whether an object is empty, return to the Boolean value.

Syntax: isnull (Expression)

Arguments:

EXAMPLE: <%

DIM I

Response.write isnull (i)

%>

Result: False

Isnumeric ()

Function: Judging whether an object is a number and returns a Boolean value.

SYNTAX: IsNumeric (Expression)

Arguments:

EXAMPLE: <%

i = "345"

Response.write isnumeric (i)

%>

Result: True

Even if the number adds quotation marks, ASP still thinks it is a number.

IsObject ()

Function: Judging whether an object is an object, return to the Boolean value.

Syntax: IsObject (Expression)

Arguments:

EXAMPLE: <%

Set con = Server.createObject ("AdoDb.Connection")

Response.Write IsObject (con)

%>

Result: True

Lbound ()

Function: Returns the minimum available subscript of the specified array dimension.

Syntax: lbound (arrayname [, dimension])

Arguments:; Dimension indicates which dimension to return. Use 1 to represent the first dimension, 2

Represents the second dimension, so that this is pushed. If the Dimension parameter is omitted, the default value is 1.

EXAMPLE: <%

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

Response.write lbound (i)

%>

RESULT: 0

Lcase ()

Function: Returns the lowercase form of the string

Syntax: Lcase (String)

Arguments: string is any valid string expression.

EXAMPLE: <%

strTrtest = "this is a test!"

Response.write Lcase (StRTEST)

%>

Result: this is a test!

Left ()

Function: Returns the previous character (including Changth characters) previously character (including Changth characters) on the left side of the string.

Syntax: Left (String, Length)

Arguments:

EXAMPLE: <%

strTrtest = "this is a test!"

Response.write Left (strTest, 3)

%>

Result: thi

Len ()

Function: Returns the length of the string.

Syntax: Len (String | Varname)

Arguments:

EXAMPLE: <%

strTrtest = "this is a test!"

Response.write len (strTest)

%>

RESULT: 15

Ltrim ()

Function: Remove the space left on the left side of the string.

Syntax: Ltrim (String)

Arguments:

Example: <% strTest = "this is a test!"

Response.write Ltrim (StRTEST)

%>

Result: this is a test!

MID ()

Function: Returns a string of specific lengths (starting from START, length length).

Syntax: MID (String, Start [, Length])

Arguments:

EXAMPLE: <%

Strtest = "this is a test! Today is monday."

Response.write Mid (Strtest, 17, 5)

%>

Result: Today

Minute ()

Function: Return time division.

Syntax: Minute (TIME)

Arguments:

EXAMPLE: <% = minute (# 12: 45: 32 pm #)%>

Result: 45

Month ()

Function: Return date.

Syntax: Month (Date)

Arguments: Date is any valid date expression.

EXAMPLE: <% = month (# 08/04/99 #)%>

RESULT: 8

Monthname ()

Function: Returns a string Identifying the specified month.

SYNTAX: MONTHNAME (Month, [, ABB])

Arguments: Month Is The Numeric Representation for a Given Month; ABB

(optional) IS a boolean value used to display month abbreviation. True

Will Display The Abbreviated Month Name and false (default) WILL NOT SHOW

The abbreviation.

EXAMPLE: <% = MONTHNAME (Month (# 08/04/99 #))%>

Result: August

Now ()

Function: Returns The Current System Date and Time.

SYNTAX: now ()

Arguments: None

EXAMPLE: <% = no%>

Result: 8/4/99 9:30:16 AM

Replace ()

Function: Returns a string in Which a specified sub-string Has been

Replaced with another substring a specified number of time.

SYNTAX: Replace (Strtobesearched, Strsearchfor, Strreplacewith "[, Start

] [, COUNT] [, Compare]]])

Arguments: string expression containing a sub-

String to be replaced; strsserchfor is the string express to search for

Withnin strabsearched; strreplacewith is the string expression to replace

Sub-string strsearchfor; start (optional) is the numeric character

................... ..

EXAMPLE: <%

strTRTEST = "this is an apple!"

Response.Write Replace (Strtest, "Apple", "Orange")

%>

Result: this is an align!

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

New Post(0)