ASP中的函数说明[3]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 asthlon 的 blog

 result:32

rtrim()
 function:去掉字符串右边的字符串.
 syntax:rtrim(string)
 arguments:
 example:<%
strtest = "this is a test!! "
response.write rtrim(strtest)
%>
 result:this is a test!!

second()
 function:返回秒.
 syntax:second(time)
 arguments:.
 example:<%=second(#12:34:28 pm#)%>
 result:28

strreverse()
 function:反排一字符串
 syntax:strreverse(string)
 arguments:
 example:<%
strtest = "this is a test!!"
response.write strreverse(strtest)
%>
 result:!!tset a si siht

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 [, firstdayofweek])
 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

本文关键:ASP中的函数说明
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top