top
Loading...
asp函數介紹-4
31.函數monthname()
功能:返回月份的字符串(名稱).
格式:Monthname(date [,abb])
參數:date是日期變量,abb=true時 則月份的縮寫,
例子:
<% =monthname(#4/5/99#) %>
結果:April
32.函數Now()
功能:返回系統的當前時間和日期.
格式:now()
參數:無
例子:
<% =now() %>
結果: 05/10/00 8:45:32 pm
33.函數:replace()
功能:在字串中查找,替代指定的字串.
格式:replace(strtobesearched,strsearchfor,strreplacewith

[,start[,count[,compare]]])
參數:strtobesearched是字串; strsearchfor是被查找的子字串;strreplacewith

是用來替代的子字串.start,count,compare 是任意選項.
例子:
<%
strtest="this is an apple."
response.write replace(strtest,"apple","orange")
%>
結果:this is an orange.
34.函數right()
功能:截取一個字符串的后部分
格式:right(string,length)
參數:string字符串,length截取的長度.
例子:
<%
strtest="this is a test!"
response.write right(strtest,3)
%>
結果:st!
35.函數rnd()
功能:返回一個隨機數值
格式:rnd[(number)]
參數:number是任意數值.
例子:
<%
randomize()
response.write rnd()
%>
結果:0/1數值之一,無randomize(), 則不能產生隨機數.
36.函數round()
功能:完整數值
格式:round(expression[,numright])
參數:expression數字表達式;numright任意選項.
例子:
<%
i=12.33654
response.write round(i)
%>
結果: 12
37.函數rtrim()
功能:去掉字符串后的空格.
格式:rtrim(string)
參數:string 是字串
例子:
<%
response.write rtrim("this is a test! ")
%>
結果:this is a test!
38.函數second()
功能:返回一個整數值.
格式:second(time)
參數:time是一個有效的時間表達式;
例子:<% =second(# 12:28:30#) %>
結果:30
39.函數strReverse()
功能:返回與原字串排列逆向的字串.
格式:strreverse(string)
參數:string是字串
例子:<% =strreverse("this is a test!")
結果:!tset a si siht
40.函數time()
功能:返回當前系統的時間值.
格式:time()
參數:無
結果:9:58:28 Am
作者:http://www.zhujiangroad.com
來源:http://www.zhujiangroad.com
北斗有巢氏 有巢氏北斗