top
Loading...
asp函數介紹-5(完)
41.函數trim()
功能:刪去字符串前,后的空格.
格式:trim(string)
參數:string 字串.
例子:
<%
strtest=" this is a test! "
response.write trim(strtest)
%>
結果:this is a test!
42.函數UBound()
功能:返回一個數組的上界.
格式:Ubound(expression [,dimension])
參數:expression 是數組表達式/數組變量,dimension 是任意項
例子:
<%
i = array("1","2","3")
response.write ubound(i)
%>
結果: 2
43.函數:UCase()
功能:將一字符類型變量的字符全部變換成大寫字符.
格式:Ucase(string)
參數:string是字串變量
例子:
<%
str="THIS is Lcase!"
response.write Lcase(str)

%>
結果:THIS IS LCASE!
44.函數Vartype()
功能:返回變量的常量代碼(整數)
格式:Vartype(varname)
參數:varname是任何類型的變量名稱.
例子:
<%
i=5
response.write vartype(i)
%>
結果:2 (2表示整數,須要參考ASP常量代碼.)
45.函數Weekday()
功能:返回一個整數,對應一周中的第幾天.
格式:Weekday(date [,firstofweek])
參數:date為日期變量,firstofweek為任選項.
例子:
<%
d= # 5/9/00 #
response.write weekday(d) %>
結果:3(3 表示是星期二)
46.函數weekdayname()
功能:返回字串,對應星期幾.
格式:weekdayname(weekday[,abb[,firstdayofweek]])
參數:weekday為日期變量,abb,firstdayofweek為任選項.
例子:
<%
d = #8/4/99#
response.write weekdayname(d)
%>
結果: Wednesday
47.函數year()
功能:返回日期表達式所在的年份.
格式:year(date)
參數:date是有效的日期表達式
例子:
<% =year(#8/9/99#) %>
結果:1999

作者:http://www.zhujiangroad.com
來源:http://www.zhujiangroad.com
北斗有巢氏 有巢氏北斗