ASP 系列函數大全(4)
發表于:2007-06-30來源:作者:點擊數:
標簽:
Rnd() 函數產生一個隨機數. 表達式 Rnd [ (number) ] 實例: % Randomize() response.write RND() %> 返回結果: 任何一個在0 到 1 之間的數 Round() 函數返回按指定位數進行四舍五入的數值. 表達式 Round(expression [, numRight]) 實例: % i = 32.45678 re
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
StrReverse()
函數反排一字符串
表達式 StrReverse(string)
實例: <%
strTest = "This is a test!!"
response.write StrReverse(strTest)
%>
返回結果: !!tset a si sihT
Time()
函數返回系統時間.
表達式 Time()
實例: <%=Time%>
返回結果: 9:58:28 AM
Trim()
函數去掉字符串左右的空格.
表達式 Trim(string)
實例: <%
strTest = " This is a test!! "
response.write Trim(strTest)
%>
返回結果: This is a test!!
UBound()
函數返回指定數組維數的最大可用下標>.
表達式 Ubound(arrayname [, dimension])
實例: <%
i = Array("Monday","Tuesday","Wednesday")
response.write UBound(i)
%>
返回結果: 2
UCase()
函數返回字符串的大寫形式.
表達式 UCase(string)
允許數據類型:
實例: <%
strTest = "This is a test!!"
response.write UCase(strTest)
%>
返回結果: THIS IS A TEST!!
VarType()
函數返回指示變量子類型的值
表達式 VarType(varName)
實例: <%
i = 3
response.write varType(i)
%>
返回結果: 2(數字)詳見"ASP常數"
WeekDay()
函數返回在一周的第幾天.
表達式 WeekDay(date [, firs
tdayofweek])
實例: <%
d = #9/9/00#
response.write Weekday(d)
%>
返回結果: 4(星期三)
WeekDayName()
函數返回一周第幾天的名字.
表達式 WeekDayName(weekday [, Abb [, firstdayofweek]])
實例: <%
d = #9/9/00#
response.write WeekdayName(Weekday(d))
%>
返回結果: Wednesday
Year()
函數返回當前的年份.
表達式 Year(date)
實例: <%=Year(#9/9/00#)%>
返回結果: 1999
原文轉自:http://www.kjueaiud.com