html5中文学习网

您的位置: 首页 > 网络编程 > ASP编程 » 正文

Asp 函数介绍(二)_ASP教程_编程技术

[ ] 已经帮助:人解决问题
函数
24.函Lcase()
功能:一字符型量的字符全部小字符.
格式:Lcase(string)
:string是字串量
例子:
<%
str="THIS is Lcase!"
response.write Lcase(str)
%>
果:this is lcase!
25.函left()
功能:截取一字符串的前部分;
格式:left(string,length)
:string字符串,length截取的度.
例子: <% =left("this is a test!",6) %>
果:this i
26.函len()
功能:返回字符串度或者量的字度
格式:len(string |varname)
:string字符串;varname任意的量名
例子:
<%
strtest="this is a test!"
response.write left(strtest)
%>
果:15
27.函ltrim()
功能:去掉字符串前的空格.
格式:ltrim(string)
:string 字串.
例子: <% =ltrim (" this is a test!")
果:this is a test!
28.函Mid()
功能:字串中截取字串.
格式:mid(string,start [,length])
:string字串,start截取的起,length要截取的度.
例子:
<%
strtest="this is a test, Today is Monday!"
response.write mid(strtest,17,5)
%>
果:Today
29.函minute()
功能:返回一值, 表示分
格式:minute(time)
: time是量
例子lt;% =minute(#12:23:34#) %>
果:23
30.函month()
功能:返回一值, 表示月份
格式:month(time)
:time是日期量
例子<% =month(#08/09/99) %>
果:9
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是一有效的表式;
例子lt;% =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
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
9uJHTML5中文学习网 - HTML5先行者学习网
9uJHTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助