ASP下经常用的字符串等函数参考资料(9)
SYNTAX: Right(string, length)
ARGUMENTS: .
EXAMPLE: <%
strTest = "This is an test!"
response.write Right(strTest, 3)
%>
RESULT: st!
Rnd()
FUNCTION: 产生一个随机数.
SYNTAX: Rnd [ (number) ]
ARGUMENTS:
EXAMPLE: <%
Randomize()
response.write RND()
%>
RESULT: 任何一个在0 到 1 之间的数
Round()
FUNCTION: 返回按指定位数进行四舍五入的数值.
SYNTAX: Round(expression [, numRight])
ARGUMENTS: numRight数字表明小数点右边有多少位进行四舍五入。如果省略,则
Round 函数返回整数.
EXAMPLE: <%
i = 32.45678
response.write Round(i)
%>
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: 返回字符串的大写形式.
内容版权声明:除非注明,否则皆为本站原创文章。