ASP实用函数库(10)
发表于:2007-06-30来源:作者:点击数:
标签:
Time() FUNCTION: 返回系统时间. SYNTAX: Time() ARGUMENTS: . EXAMPLE: %=Time%> RESULT: 9:58:28 AM Trim() FUNCTION: 去掉字符串左右的空格. SYNTAX: Trim(string) ARGUMENTS: string is any valid string expression. EXAMPLE: % strTest = " This is a
Time()
FUNCTION: 返回系统时间.
SYNTAX: Time()
ARGUMENTS: .
EXAMPLE: <%=Time%>
RESULT: 9:58:28 AM
Trim()
FUNCTION: 去掉字符串左右的空格.
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: 返回指定数组维数的最大可用下标.
SYNTAX: Ubound(arrayname [, dimension])
ARGUMENTS: ; dimension (optional) 指定返回哪一维上界的整数。1 表示第一
维,2 表示第二维,以此类推。如果省略 dimension 参数,则默认值为 1.
EXAMPLE: <%
i = Array("Monday","Tuesday","Wednesday")
response.write UBound(i)
%>
RESULT: 2
UCase()
FUNCTION: 返回字符串的大写形式.
SYNTAX: UCase(string)
ARGUMENTS:
EXAMPLE: <%
strTest = "This is a test!!"
response.write UCase(strTest)
%>
RESULT: THIS IS A TEST!!
VarType()
FUNCTION: 返回指示变量子类型的值
SYNTAX: VarType(varName)
ARGUMENTS:
EXAMPLE: <%
i = 3
response.write varType(i)
%>
RESULT: 2(数字)详见"ASP常数"
WeekDay()
FUNCTION: 返回在一周的第几天.
SYNTAX: WeekDay(date [, firs
tdayofweek])
ARGUMENTS: .
EXAMPLE: <%
d = #8/4/99#
response.write Weekday(d)
%>
RESULT: 4(星期三)
WeekDayName()
FUNCTION: 返回一周第几天的名字.
SYNTAX: WeekDayName(weekday [, Abb ][, firstdayofweek]])
ARGUMENTS: Abb可选。Boolean 值,指明是否缩写表示星期各天的名称。如果省
略, 默认值为 False,即不缩写星期各天的名称.firstdayofweek指明星期第一天的
数值
EXAMPLE: <%
d = #8/4/99#
response.write WeekdayName(Weekday(d))
%>
RESULT: Wednesday
Year()
FUNCTION: 返回当前的年份.
SYNTAX: Year(date)
ARGUMENTS:
EXAMPLE: <%=Year(#8/4/99#)%>
RESULT: 1999
原文转自:http://www.ltesting.net