最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

ASP中常用的函數和詳細說明

 更新時間:2007年03月02日 00:00:00   作者:  

20.函數month() 
功能:返回一數值, 表示月份 
格式:month(time) 
參數:time是日期變量 
例子<% =month(#08/09/99) %> 
結果:9 
21.函數monthname() 
功能:返回月份的字符串(名稱). 
格式:Monthname(date [,abb]) 
參數: date是日期變量,abb=true時 則月份的縮寫, 
例子: 
<% =monthname(#4/5/99#) %> 
結果:April 
22.函數Now() 
功能:返回系統(tǒng)的當前時間和日期. 
格式:now() 
參數:無 
例子: 
<% =now() %> 
結果: 05/10/00 8:45:32 pm 
23.函數: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. 
24.函數right() 
功能:截取一個字符串的后部分 
格式:right(string,length) 
參數:string字符串,length截取的長度. 
例子: 
<% 
strtest="this is a test!" 
response.write right(strtest,3) 
%> 
結果:st! 
25.函數rnd() 
功能:返回一個隨機數值 
格式:rnd[(number)] 
參數:number是任意數值. 
例子: 
<% 
randomize() 
response.write rnd() 
%> 
結果:0/1數值之一,無randomize(), 則不能產生隨機數. 
26.函數round() 
功能:完整數值 
格式:round(expression[,numright]) 
參數:expression數字表達式;numright任意選項. 
例子: 
<% 
i=12.33654 
response.write round(i) 
%> 
結果: 12 
27.函數rtrim() 
功能:去掉字符串后的空格. 
格式:rtrim(string) 
參數:string 是字符串 
例子: 
<% 
response.write rtrim("this is a test! ") 
%> 
結果:this is a test! 
28.函數second() 
功能:返回一個整數值. 
格式:second(time) 
參數:time是一個有效的時間表達式; 
例子lt;% =second(# 12:28:30#) %> 
結果:30 
29.函數strReverse() 
功能:返回與原字符串排列逆向的字符串. 
格式:strreverse(string) 
參數:string是字符串 
例子<% =strreverse("this is a test!") 
結果:!tset a si siht 
30.函數time() 
功能:返回當前系統(tǒng)的時間值. 
格式:time() 
參數:無 
結果:9:58:28 Am 
31.函數trim() 
功能:刪去字符串前,后的空格. 
格式:trim(string) 
參數:string 字符串. 
例子: 
<% 
strtest=" this is a test! " 
response.write trim(strtest) 
%> 
結果:this is a test! 
32.函數UBound() 
功能:返回一個數組的上界. 
格式:Ubound(expression [,dimension]) 
參數:expression 是數組表達式/數組變量,dimension 是任意項 
例子: 
<% 
i = array("1","2","3") 
response.write ubound(i) 
%> 
結果: 2 
33.函數:UCase() 
功能:將一字符類型變量的字符全部變換成大寫字符. 
格式:Ucase(string) 
參數:string是字符串變量 
例子: 
<% 
str="THIS is Lcase!" 
response.write Lcase(str) 
%> 
結果:THIS IS LCASE! 
34.函數Vartype() 
功能:返回變量的常量代碼(整數) 
格式:Vartype(varname) 
參數:varname是任何類型的變量名稱. 
例子: 
<% 
i=5 
response.write vartype(i) 
%> 
結果:2 (2表示整數,須要參考ASP常量代碼.) 
35.函數Weekday() 
功能:返回一個整數,對應一周中的第幾天. 
格式:Weekday(date [,firstofweek]) 
參數: date為日期變量,firstofweek為任選項. 
例子: 
<% 
d= # 5/9/00 # 
response.write weekday(d) %> 
結果:3(3 表示是星期二) 
36.函數weekdayname() 
功能:返回字符串,對應星期幾. 
格式:weekdayname(weekday[,abb[,firstdayofweek]]) 
參數:weekday為日期變量,abb,firstdayofweek為任選項. 
例子: 
<% 
d = #8/4/99# 
response.write weekdayname(d) 
%> 
結果: Wednesday 
37.函數year() 
功能:返回日期表達式所在的年份. 
格式:year(date) 
參數: date是有效的日期表達式 
例子: 
<% =year(#8/9/99#) %> 
結果:1999 
38.函數Mod()功能:取余數.
例子:3 Mod 2 
結果:1
我先介紹一下Split函數的用法:
 返回值數組 = Split("字符串","分割符")

39.split函數的應用 
作者:李春光 轉貼自:本站原創(chuàng) 點擊數:113 文章錄入: 

split 是一個分隔字符串的函數,它的作用是把用特定分隔符隔開的字符串轉化為一個數組,這在編程中用的比較多,如上傳多張圖片,在數庫中僅能用一個字段存儲的情況下,split就起作用了,下面是一個具體的例子,和數組結合使用.

<%
dim str1
str1="icerain|fengling|windbell|"
aryReturn=split(str1,"|")
response.write "返回的是否為數組"&IsArray(aryReturn)
response.write "<br>"
for i=LBound(aryReturn) TO UBound(aryReturn)
response.write aryReturn(i)
response.write "<br>"
next
response.end
%>
Rnd()  
 
函數產生一個隨機數.  
 
表達式 Rnd [ (number) ]  
 
實例: <% 
 
Randomize() 
response.write RND() 
 
%>  
 
返回結果: 任何一個在0 到 1 之間的數

相關文章

最新評論

都安| 奈曼旗| 会昌县| 中阳县| 沅江市| 岳阳县| 南城县| 都昌县| 高碑店市| 彰化县| 桐庐县| 尼勒克县| 浑源县| 武山县| 陕西省| 泗阳县| 绵阳市| 呼伦贝尔市| 汝南县| 高陵县| 松江区| 茂名市| 木里| 伊川县| 灵台县| 邵阳县| 和田市| 栾川县| 林周县| 侯马市| 潜江市| 普安县| 敦煌市| 中超| 博野县| 东至县| 樟树市| 南丰县| 石城县| 葫芦岛市| 进贤县|