欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp 類型轉(zhuǎn)換函數(shù)大全第2/2頁

 更新時(shí)間:2008年10月20日 23:01:33   作者:  
asp 類型轉(zhuǎn)換的實(shí)現(xiàn)函數(shù)

IsObject() 
 
函數(shù)判斷一對(duì)象是否為對(duì)象, | 布爾值. 
 
表達(dá)式 IsObject(expression) 
 
實(shí)例: <% 
 
Set con = Server.CreateObject("ADODB.Connection") 
 
response.write IsObject(con) 
 
%> 
 
| 結(jié)果: True 
 
 
Lbound() 
 
函數(shù) | 指定數(shù)組維的最小可用下標(biāo). 
 
表達(dá)式 Lbound(arrayname [, dimension]) 
 
實(shí)例: <% 
 
I = Array("Monday","Tuesday","Wednesday") 
 
response.write Lbound(I) 
 
%> 
 
| 結(jié)果: 0 
 
 
Lcase() 
 
函數(shù) | 字符串的小寫形式 
 
表達(dá)式 Lcase(string) 
 
實(shí)例: <% 
 
strTest = "This is a test!" 
 
response.write Lcase(strTest) 
 
%> 
 
| 結(jié)果: this is a test! 
 
 
Left() 
 
函數(shù) | 字符串左邊第length個(gè)字符以前的字符(含第length個(gè)字符). 
 
表達(dá)式 Left(string, length) 
 
實(shí)例: <% 
 
strTest = "This is a test!" 
 
response.write Left(strTest, 3) 
 
%> 
 
| 結(jié)果: Thi 
 
 
Len() 
 
函數(shù) | 字符串的長(zhǎng)度. 
 
表達(dá)式 Len(string | varName) 
 
實(shí)例: <% 
 
strTest = "This is a test!" 
 
response.write Len(strTest) 
 
%> 
 
| 結(jié)果: 15 
 
 
Ltrim() 
 
函數(shù)去掉字符串左邊的空格. 
 
表達(dá)式 Ltrim(string) 
 
實(shí)例: <% 
 
strTest = " This is a test!" 
 
response.write Ltrim(strTest) 
 
%> 
 
| 結(jié)果: This is a test! 
 
 
Mid() 
 
函數(shù) | 特定長(zhǎng)度的字符串(從start開始,長(zhǎng)度為length). 
 
表達(dá)式 Mid(string, start [, length]) 
 
實(shí)例: <% 
 
strTest = "This is a test! Today is Monday." 
 
response.write Mid(strTest, 17, 5) 
 
%> 
 
| 結(jié)果: Today 
 
 
Minute() 
 
函數(shù) | 時(shí)間的分鐘. 
 
表達(dá)式 Minute(time) 
 
實(shí)例: <%=Minute(#12:45:32 PM#)%> 
 
| 結(jié)果: 45 
 
 
Month() 
 
函數(shù) | 日期. 
 
表達(dá)式 Month(date) 
 
實(shí)例: <%=Month(#08/04/99#)%> 
 
| 結(jié)果: 8 
 
 
MonthName() 
 
函數(shù) | 指定月份 
 
表達(dá)式 MonthName(month, [, Abb]) 
 
實(shí)例: <%=MonthName(Month(#08/04/99#))%> 
 
| 結(jié)果: August 
 
 
Now() 
 
函數(shù) | 系統(tǒng)時(shí)間 
 
表達(dá)式 Now() 
 
實(shí)例: <%=Now%> 
 
| 結(jié)果: 9/9/00 9:30:16 AM 
 
 
Right() 
 
函數(shù) | 字符串右邊第length個(gè)字符以前的字符(含第length個(gè)字符). 
 
表達(dá)式 Right(string, length) 
 
實(shí)例: <% 
 
strTest = "This is an test!" 
 
response.write Right(strTest, 3) 
 
%> 
 
| 結(jié)果: st! 
 
 
Rnd() 
 
函數(shù)產(chǎn)生一個(gè)隨機(jī)數(shù). 
 
表達(dá)式 Rnd [ (number) ] 
 
實(shí)例: <% 
 
Randomize()
response.write RND() 
 
%> 
 
| 結(jié)果: 任何一個(gè)在0 到 1 之間的數(shù)
等待 發(fā)表于 2008-2-25 17:08
instr 查找 索引 函數(shù)
instr 函數(shù)
表達(dá)式:
InStr([start, ]string1, string2[, compare])
描述:
start
可選參數(shù)。為數(shù)值表達(dá)式,設(shè)置每次搜索的起點(diǎn)。如果省略,將從第一個(gè)字符的位置開始。如果 start 包含 Null,將發(fā)生錯(cuò)誤。如果指定了 compare 參數(shù),則一定要有 start 參數(shù)。
string1
必要參數(shù)。接受搜索的字符串表達(dá)式。
string2
必要參數(shù)。被搜索的字符串表達(dá)式。
Compare
可選參數(shù)。指定字符串比較。如果 compare 是 Null,將發(fā)生錯(cuò)誤。如果省略 compare,Option Compare 的設(shè)置將決定比較的類型。
compare 參數(shù)設(shè)置為:
常數(shù)

描述
vbUseCompareOption
-1
使用Option Compare 語句設(shè)置執(zhí)行一個(gè)比較。
vbBinaryCompare
0
執(zhí)行一個(gè)二進(jìn)制比較。
vbTextCompare
1
執(zhí)行一個(gè)按照原文的比較。
vbDatabaseCompare
2
僅適用于Microsoft Access,執(zhí)行一個(gè)基于數(shù)據(jù)庫中信息的比較。
返回值
返回0、1、2、-1或Null等。
異常/錯(cuò)誤

描述InStr([start, ]string1, string2[, compare])
返回指定一字符串在另一字符串中最先出現(xiàn)的位置。在字符串string1中,從start開始找string2,省略start時(shí)從string1頭開始找。找不到時(shí),函數(shù)值為0。
如果
InStr返回
string1 為零長(zhǎng)度
0
string1 為 Null
Null
string2 為零長(zhǎng)度
Start
string2 為 Null
Null
string2 找不到
0
在 string1 中找到string2
找到的位置
start > string2
0
示例
本示例使用 InStr 函數(shù)來查找某字符串在另一個(gè)字符串中首次出現(xiàn)的位置。
Dim SearchString, SearchChar, MyPos
SearchString ="XXpXXpXXPXXP" ' 被搜索的字符串。
SearchChar = "P" ' 要查找字符串 "P"。
' 從第四個(gè)字符開始,以文本比較的方式找起。返回值為 6(小寫 p)。
' 小寫 p 和大寫 P 在文本比較下是一樣的。
MyPos = Instr(4, SearchString, SearchChar, 1)
' 從第一個(gè)字符開使,以二進(jìn)制比較的方式找起。返回值為 9(大寫 P)。
' 小寫 p 和大寫 P 在二進(jìn)制比較下是不一樣的。
MyPos = Instr(1, SearchString, SearchChar, 0)
' 缺省的比對(duì)方式為二進(jìn)制比較(最后一個(gè)參數(shù)可省略)。
MyPos = Instr(SearchString, SearchChar) ' 返回 9。
MyPos = Instr(1, SearchString, "W") ' 返回 0。

相關(guān)文章

最新評(píng)論