ASP's function Details-2

Source: Internet
Author: User
Tags date array constant expression integer month name trim valid
function | LCase ()
FUNCTION: Returns the lowercase form of a string
Syntax:lcase (String)
Arguments:string is any valid string expression.
EXAMPLE: <%
Strtest = "This is a test!"
Response.Write LCase (Strtest)
%>
Result:this is a test!

Left ()
FUNCTION: Returns the previous character (including the length character) of the length of the character on the left of the string.
Syntax:left (string, length)
ARGUMENTS:
EXAMPLE: <%
Strtest = "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: <%
Strtest = "This is a test!"
Response.Write Len (Strtest)
%>
Result:15

LTrim ()
FUNCTION: Removes the space 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 a specific length, from start to length.
Syntax:mid (String, start [, length>)
ARGUMENTS:
EXAMPLE: <%
Strtest = "This is a test! The Today is Monday.
Response.Write Mid (Strtest, 17, 5)
%>
Result:today

Minute ()
FUNCTION: Returns the minute Kushiro of time.
Syntax:minute (Time)
ARGUMENTS:
EXAMPLE: <%=minute (#12:45:32 pm#)%>
Result:45

Month ()
FUNCTION: Returns the 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 would display the abbreviated month name and False (default) won't 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: <%=Now%>
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 Times.
Syntax:replace (strtobesearched, strSearchFor, strReplaceWith [, start [, Count [, compare>>>)
Arguments:strtobesearched is a string expression containing a sub-string to be replaced; strSearchFor is the string expression to search for within strtobesearched; strReplaceWith is the string expression to replace sub-string strsearchfor; Start (optional) is the numeric character position to begin search; COUNT (optional) is a value indicating the comparision constant.
EXAMPLE: <%
Strtest = "This is a apple!"
Response.Write Replace (strtest, "Apple", "orange")
%>
Result:this is an orange!

Right ()
FUNCTION: Returns the previous character (including the length of the character) of the length of the character on the right of the string.
Syntax:right (string, length)
ARGUMENTS:.
EXAMPLE: <%
Strtest = "This is a test!"
Response.Write Right (strtest, 3)
%>
result:st!

Rnd ()
FUNCTION: Produces a random number.
Syntax:rnd [(number) >
ARGUMENTS:
EXAMPLE: <%
Randomize ()
Response.Write RND ()
%>
Result: Any number between 0 and 1

Round ()
FUNCTION: Returns a value that is rounded by a specified number of digits.
Syntax:round (expression [, numright>)
The arguments:numright number indicates how many digits to the right of the decimal point are rounded. If omitted, the Round function returns an integer.
EXAMPLE: <%
i = 32.45678
Response.Write Round (i)
%>
Result:32

Rtrim ()
FUNCTION: Removes the string to the right of the string.
Syntax:rtrim (String)
ARGUMENTS:
EXAMPLE: <%
Strtest = "This is a test!!"
Response.Write RTrim (Strtest)
%>
Result:this is a test!!

Second ()
FUNCTION: Returns a second.
Syntax:second (Time)
ARGUMENTS:.
EXAMPLE: <%=second (#12:34:28 pm#)%>
Result:28

StrReverse ()
FUNCTION: Back-row 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 around 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 available subscript for the specified array dimension.
Syntax:ubound (Arrayname [, dimension>)
Arguments:dimension (optional) Specifies the integer that returns the upper bound of the dimension. 1 represents the first dimension, 2 represents the second dimension, and so on. If the dimension argument is omitted, the default value is 1.
EXAMPLE: <%
i = Array ("Monday", "Tuesday", "Wednesday")
Response.Write UBound (i)
%>
Result:2

UCase ()
FUNCTION: Returns the uppercase form of a string.
Syntax:ucase (String)
ARGUMENTS:
EXAMPLE: <%
Strtest = "This is a test!!"
Response.Write UCase (Strtest)
%>
Result:this is A test!!

VarType ()
FUNCTION: Returns a value indicating the variable quantum type
Syntax:vartype (VarName)
ARGUMENTS:
EXAMPLE: <%
i = 3
Response.Write VarType (i)
%>
Result:2 (number) See "ASP Constant"

Weekday ()
FUNCTION: Returns the day ordinal of a week.
Syntax:weekday (date [, firstdayofweek>)
ARGUMENTS:.
EXAMPLE: <%
D = #8/4/99#
Response.Write Weekday (d)
%>
Result:4 (Wednesday)

WeekdayName ()
FUNCTION: Returns the name of the day ordinal of a week.
Syntax:weekdayname (Weekday [, ABB [, firstdayofweek>>)
Arguments:abb Optional. Boolean value that indicates whether the name of the day of the week is abbreviated. If omitted, the default value is False, that is, the name of the day of the week is not abbreviated. FirstDayOfWeek Specify the first day of the week
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

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.