网络编程
位置:首页>> 网络编程>> Asp编程>> ASP函数大全(数字函数)(8)

ASP函数大全(数字函数)(8)

 来源:asp之家 发布时间:2009-06-01 12:33:00 

标签:函数,asp,时间,日期,数字


Right()

函数返回字符串右边第length个字符以前的字符(含第length个字符).

表达式 Right(string, length)

实例:

<%

strTest = "This is an test!"

response.write Right(strTest, 3)

%>

返回结果: st!


Rnd()

函数产生一个随机数.

表达式 Rnd [ (number) ]

实例:

<%

Randomize()

response.write RND()

%>

返回结果: 任何一个在0 到 1 之间的数


Round()

函数返回按指定位数进行四舍五入的数值.

表达式 Round(expression [, numRight])

实例:

<%

i = 32.45678

response.write Round(i)

%>
返回结果: 32


Rtrim()

函数去掉字符串右边的字符串.

表达式 Rtrim(string)

实例:

<%

strTest = "This is a test!! "

response.write RTrim(strTest)

%>



返回结果: This is a test!!


Split()

函数将一个字符串分割并返回分割结果

表达式 Split (S[,d])

实例:

 

<%V= Split(A,B,C)

For i = 0 To UBound(V)

Response.Write V(i)

Next

%>

返回结果: A B C


Second()

函数返回秒.

表达式 Second(time)

实例:

<%=Second(#12:34:28 PM#)%>


返回结果: 28

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com