网络编程
位置:首页>> 网络编程>> Asp编程>> ASP函数大全(数字函数)(4)

ASP函数大全(数字函数)(4)

 来源:asp之家 发布时间:2009-06-01 12:33:00 

标签:函数,asp,时间,日期,数字

Hour()

函数以24时返回小时数.

表达式 Hour(time)

允许数据类型:

实例:

<%=Hour(#4:45:34 PM#)%>

返回结果: 16

(Hour has been converted to 24-hour system)


Instr()

函数返回字符或字符串在另一个字符串中第一次出现的位置.

表达式 Instr([start, ] strToBeSearched, strSearchFor [, compare])

允许数据类型: Start为搜索的起始值,strToBeSearched接受搜索的字符串 strSearchFor要搜索的字符.compare比较方式(详细见ASP常数)

实例:

<%

strText = "This is a test!!"

pos = Instr(strText, "a")

response.write pos

%>

返回结果: 9


InstrRev()

函数同上,只是从字符串的最后一个搜索起

表达式 InstrRev([start, ] strToBeSearched, strSearchFor [, compare])

允许数据类型: 同上.

实例:

<%

strText = "This is a test!!"

pos = InstrRev(strText, "s")

response.write pos

%>

返回结果: 13


Int()

函数返回数值类型,不四舍五入。

表达式 Int(number)

允许数据类型:

实例:

<%=INT(32.89)%>
返回结果: 32

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com