1. ASP常用函数表(新手们的好工具)
  2. 作者:未知  
  3. Array()
  4. 函数返回一个数组
  5. 表达式 Array(list)
  6. 允许数据类型: 字符,数字均可
  7. 实例: <%
  8. Dim myArray()
  9. For i = 1 to 7
  10. Redim Preserve myArray(i)
  11. myArray(i) = WeekdayName(i)
  12. Next
  13. %>
  14. 返回结果: 建立了一个包含7个元素的数组myArray
  15. myArray("Sunday","Monday", ... ... "Saturday")
  16. CInt()
  17. 函数将一个表达式转化为数字类型
  18. 表达式 CInt(expression)
  19. 允许数据类型: 任何有效的字符均可(不大于32767)
  20. 实例: <%
  21. f = "234"
  22. response.write cINT(f) + 2
  23. %>
  24. 返回结果: 236
  25. 转化字符"234"为数字"234",如果字符串为空,则返回0
  26.  
  27. CreateObject()
  28. 函数建立和返回一个已注册的ACTIVEX组件的实例。
  29. 表达式 CreateObject(objName)
  30. 允许数据类型: objName 是任何一个有效、已注册的ACTIVEX组件的名字.
  31. 实例: <%
  32. Set con = Server.CreateObject("ADODB.Connection")
  33. %>
  34.  
  35. CStr()
  36. 函数转化一个表达式为字符串.
  37. 表达式 CStr(expression)
  38. 允许数据类型: expression 是任何有效的表达式。
  39. 实例: <%
  40. s = 3 + 2
  41. response.write "The 返回结果 is: " & cStr(s)
  42. %>
  43. 返回结果: 转化数字“5”为字符“5”。
  44.  
  45. Date()
  46. 函数返回当前系统日期.
  47. 表达式 Date()
  48. 允许数据类型: None.
  49. 实例: <%=Date%>
  50. 返回结果: 9/9/00
  51.  
  52. DateAdd()
  53. 函数返回一个被改变了的日期。
  54. 表达式 DateAdd(timeinterval,number,date)
  55. 允许数据类型:
  56. timeinterval is the time interval to add;
  57. number is amount of time intervals to add;
  58. and date is the starting date.
  59. 实例: <%
  60. currentDate = #9/9/00#
  61. newDate = DateAdd("m",3,currentDate)
  62. response.write newDate
  63. %>
  64. <%
  65. currentDate = #12:34:45 PM#
  66. newDate = DateAdd("h",3,currentDate)
  67. response.write newDate
  68. %>
  69. 返回结果: 9/9/00
  70. 3:34:45 PM
  71. "m" = "month";
  72. "d" = "day";
  73. If currentDate is in time format then,
  74. "h" = "hour";
  75. "s" = "second";
  76.  
  77. DateDiff()
  78. 函数返回两个日期之间的差值
  79. 表达式 DateDiff(timeinterval,date1,date2 [, firstdayofweek [, firstweekofyear]])
  80. 允许数据类型: timeinterval 表示相隔时间的类型,如“M“表示“月”。
  81. 实例: <%
  82. fromDate = #9/9/00#
  83. toDate = #1/1/2000#
  84. response.write "There are " & _
  85. DateDiff("d",fromDate,toDate) & _
  86. " days to millenium from 9/9/00."
  87. %>
  88. 返回结果: 9/9/00 2000年还有 150 天.
  89.  
  90. Day()
  91. 函数返回一个月的第几日 .
  92. 表达式 Day(date)
  93. 允许数据类型: date 是任何有效的日期。
  94. 实例: <%=Day(#9/9/00#)%>
  95. 返回结果: 9
  96.  
  97. formatCurrency()
  98. 函数返回表达式,此表达式已被格式化为货币值
  99. 表达式 formatCurrency(Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]])
  100. 允许数据类型: Digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置; LeadingDigit 三态常数,指示是否显示小数值小数点前面的零。
  101. 实例: <%=formatCurrency(34.3456)%>
  102. 返回结果: $34.35
  103.  
  104. formatDateTime()
  105. 函数返回表达式,此表达式已被格式化为日期或时间
  106. 表达式 formatDateTime(Date, [, Namedformat])
  107. 允许数据类型: Namedformat 指示所使用的日期/时间格式的数值,如果省略,则使用 vbGeneralDate.
  108. 实例: <%=formatDateTime("09/9/00", vbLongDate)%>
  109. 返回结果: Sunday, September 09, 2000
  110.  
  111. formatNumber()
  112. 函数返回表达式,此表达式已被格式化为数值.
  113. 表达式 formatNumber(Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]])
  114. 允许数据类型: Digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。; LeadingDigit i指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。; Paren 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。; GroupDigit i指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。.
  115. 实例: <%=formatNumber(45.324567, 3)%>
  116. 返回结果: 45.325
  117.  
  118. formatPercent()
  119. 函数返回表达式,此表达式已被格式化为尾随有 % 符号的百分比(乘以 100 )。 (%)
  120. 表达式 formatPercent(Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]])
  121. 允许数据类型: 同上.
  122. 实例: <%=formatPercent(0.45267, 3)%>
  123. 返回结果: 45.267%
  124.  
  125. Hour()
  126. 函数以24时返回小时数.
  127. 表达式 Hour(time)
  128. 允许数据类型:
  129. 实例: <%=Hour(#4:45:34 PM#)%>
  130. 返回结果: 16
  131. (Hour has been converted to 24-hour system)
  132.  
  133. Instr()
  134. 函数返回字符或字符串在另一个字符串中第一次出现的位置.
  135. 表达式 Instr([start, ] strToBeSearched, strSearchFor [, compare])
  136. 允许数据类型: Start为搜索的起始值,strToBeSearched接受搜索的字符串 strSearchFor要搜索的字符.compare比较方式(详细见ASP常数)
  137. 实例: <%
  138. strText = "This is a test!!"
  139. pos = Instr(strText, "a")
  140. response.write pos
  141. %>
  142. 返回结果: 9
  143.  
  144. InstrRev()
  145. 函数同上,只是从字符串的最后一个搜索起
  146. 表达式 InstrRev([start, ] strToBeSearched, strSearchFor [, compare])
  147. 允许数据类型: 同上.
  148. 实例: <%
  149. strText = "This is a test!!"
  150. pos = InstrRev(strText, "s")
  151. response.write pos
  152. %>
  153. 返回结果: 13
  154.  
  155. Int()
  156. 函数返回数值类型,不四舍五入。
  157. 表达式 Int(number)
  158. 允许数据类型:
  159. 实例: <%=INT(32.89)%>
  160. 返回结果: 32
  161.  
  162. IsArray()
  163. 函数判断一对象是否为数组,返回布尔值 .
  164. 表达式 IsArray(name)
  165. 实例: <%
  166. strTest = "Test!"
  167. response.write IsArray(strTest)
  168. %>
  169. 返回结果: False
  170.  
  171. IsDate()
  172. 函数判断一对象是否为日期,返回布尔值
  173. 表达式 IsDate(expression)
  174. 实例: <%
  175. strTest = "9/4/2000"
  176. response.write IsDate(strTest)
  177. %>
  178. 返回结果: True
  179.  
  180. IsEmpty()
  181. 函数判断一对象是否初始化,返回布尔值.
  182. 表达式 IsEmpty(expression)
  183. 实例: <%
  184. Dim i
  185. response.write IsEmpty(i)
  186. %>
  187. 返回结果: True
  188.  
  189. IsNull()
  190. 函数判断一对象是否为空,返回布尔值.
  191. 表达式 IsNull(expression)
  192. 实例: <%
  193. Dim i
  194. response.write IsNull(i)
  195. %>
  196. 返回结果: False
  197.  
  198. IsNumeric()
  199. 函数判断一对象是否为数字,返回布尔值.
  200. 表达式 IsNumeric(expression)
  201. 实例: <%
  202. i = "345"
  203. response.write IsNumeric(i)
  204. %>
  205. 返回结果: True
  206. 就算数字加了引号,ASP还是认为它是数字。
  207.  
  208. IsObject()
  209. 函数判断一对象是否为对象,返回布尔值.
  210. 表达式 IsObject(expression)
  211. 实例: <%
  212. Set con = Server.CreateObject("ADODB.Connection")
  213. response.write IsObject(con)
  214. %>
  215. 返回结果: True
  216.  
  217. LBound()
  218. 函数返回指定数组维的最小可用下标.
  219. 表达式 Lbound(arrayname [, dimension])
  220. 实例: <%
  221. i = Array("Monday","Tuesday","Wednesday")
  222. response.write LBound(i)
  223. %>
  224. 返回结果: 0
  225.  
  226. LCase()
  227. 函数 返回字符串的小写形式
  228. 表达式 Lcase(string)
  229. 实例: <%
  230. strTest = "This is a test!"
  231. response.write LCase(strTest)
  232. %>
  233. 返回结果: this is a test!
  234.  
  235. Left()
  236. 函数返回字符串左边第length个字符以前的字符(含第length个字符).
  237. 表达式 Left(string, length)
  238. 实例: <%
  239. strTest = "This is a test!"
  240. response.write Left(strTest, 3)
  241. %>
  242. 返回结果: Thi
  243.  
  244. Len()
  245. 函数返回字符串的长度.
  246. 表达式 Len(string | varName)
  247. 实例: <%
  248. strTest = "This is a test!"
  249. response.write Len(strTest)
  250. %>
  251. 返回结果: 15
  252.  
  253. LTrim()
  254. 函数去掉字符串左边的空格.
  255. 表达式 LTrim(string)
  256. 实例: <%
  257. strTest = " This is a test!"
  258. response.write LTrim(strTest)
  259. %>
  260. 返回结果: This is a test!
  261.  
  262. Mid()
  263. 函数返回特定长度的字符串(从start开始,长度为length).
  264. 表达式 Mid(string, start [, length])
  265. 实例: <%
  266. strTest = "This is a test! Today is Monday."
  267. response.write Mid(strTest, 17, 5)
  268. %>
  269. 返回结果: Today
  270.  
  271. Minute()
  272. 函数返回时间的分钟.
  273. 表达式 Minute(time)
  274. 实例: <%=Minute(#12:45:32 PM#)%>
  275. 返回结果: 45
  276.  
  277. Month()
  278. 函数返回日期.
  279. 表达式 Month(date)
  280. 实例: <%=Month(#08/04/99#)%>
  281. 返回结果: 8
  282.  
  283. MonthName()
  284. 函数返回指定月份
  285. 表达式 MonthName(month, [, Abb])
  286. 实例: <%=MonthName(Month(#08/04/99#))%>
  287. 返回结果: August
  288.  
  289. Now()
  290. 函数返回系统时间
  291. 表达式 Now()
  292. 实例: <%=Now%>
  293. 返回结果: 9/9/00 9:30:16 AM
  294.  
  295. Right()
  296. 函数返回字符串右边第length个字符以前的字符(含第length个字符).
  297. 表达式 Right(string, length)
  298. 实例: <%
  299. strTest = "This is an test!"
  300. response.write Right(strTest, 3)
  301. %>
  302. 返回结果: st!
  303.  
  304. Rnd()
  305. 函数产生一个随机数.
  306. 表达式 Rnd [ (number) ]
  307. 实例: <%
  308. Randomize()
  309. response.write RND()
  310. %>
  311. 返回结果: 任何一个在0 1 之间的数
  312.  
  313. Round()
  314. 函数返回按指定位数进行四舍五入的数值.
  315. 表达式 Round(expression [, numRight])
  316. 实例: <%
  317. i = 32.45678
  318. response.write Round(i)
  319. %>
  320. 返回结果: 32
  321.  
  322. Rtrim()
  323. 函数去掉字符串右边的字符串.
  324. 表达式 Rtrim(string)
  325. 实例: <%
  326. strTest = "This is a test!! "
  327. response.write RTrim(strTest)
  328. %>
  329. 返回结果: This is a test!!
  330.  
  331. Split()
  332. 函数将一个字符串分割并返回分割结果
  333. 表达式 Split (S[,d])
  334. 实例:<%V= Split(A,B,C)
  335. For i = 0 To UBound(V)
  336. Response.Write V(i)
  337. Next
  338. %>
  339. 返回结果: A B C
  340.  
  341. Second()
  342. 函数返回秒.
  343. 表达式 Second(time)
  344. 实例: <%=Second(#12:34:28 PM#)%>
  345. 返回结果: 28
  346.  
  347. StrReverse()
  348. 函数反排一字符串
  349. 表达式 StrReverse(string)
  350. 实例: <%
  351. strTest = "This is a test!!"
  352. response.write StrReverse(strTest)
  353. %>
  354. 返回结果: !!tset a si sihT
  355.  
  356. Time()
  357. 函数返回系统时间.
  358. 表达式 Time()
  359. 实例: <%=Time%>
  360. 返回结果: 9:58:28 AM
  361.  
  362. Trim()
  363. 函数去掉字符串左右的空格.
  364. 表达式 Trim(string)
  365. 实例: <%
  366. strTest = " This is a test!! "
  367. response.write Trim(strTest)
  368. %>
  369. 返回结果: This is a test!!
  370.  
  371. UBound()
  372. 函数返回指定数组维数的最大可用下标>.
  373. 表达式 Ubound(arrayname [, dimension])
  374. 实例: <%
  375. i = Array("Monday","Tuesday","Wednesday")
  376. response.write UBound(i)
  377. %>
  378. 返回结果: 2
  379.  
  380. UCase()
  381. 函数返回字符串的大写形式.
  382. 表达式 UCase(string)
  383. 允许数据类型:
  384. 实例: <%
  385. strTest = "This is a test!!"
  386. response.write UCase(strTest)
  387. %>
  388. 返回结果: THIS IS A TEST!!
  389.  
  390. VarType()
  391. 函数返回指示变量子类型的值
  392. 表达式 VarType(varName)
  393. 实例: <%
  394. i = 3
  395. response.write varType(i)
  396. %>
  397. 返回结果: 2(数字)详见"asp常数"
  398.  
  399. WeekDay()
  400. 函数返回在一周的第几天.
  401. 表达式 WeekDay(date [, firstdayofweek])
  402. 实例: <%
  403. d = #9/9/00#
  404. response.write Weekday(d)
  405. %>
  406. 返回结果: 4(星期三)
  407.  
  408. WeekDayName()
  409. 函数返回一周第几天的名字.
  410. 表达式 WeekDayName(weekday [, Abb [, firstdayofweek]])
  411. 实例: <%
  412. d = #9/9/00#
  413. response.write WeekdayName(Weekday(d))
  414. %>
  415. 返回结果: Wednesday
  416.  
  417. Year()
  418. 函数返回当前的年份.
  419. 表达式 Year(date)
  420. 实例: <%=Year(#9/9/00#)%>
  421. 返回结果: 1999
  422.  
  423. 程序定制QQ70632246 ,广告联系QQ7598454 网站制作服务 成功案例 版权声明 站长信箱
  424. VIP源码
  425. 网友投搞
  426. 在线投诉
  427. 广告服务
  428.  
  429. 首页 | 源码下载 | 网站开发 | 开发工具 | 网络安全 | 服务器 | 建站学堂 | 网页模板 | 教程下载 | 图片素材库 | 源码市场 | 建站论坛
  430. 您的位置:首页 - 网站开发 - ASP - 阅读文章 网站开发服务器网络安全开发工具源码下载源码求购源码出售
  431. ASP常用函数表(新手们的好工具)
  432. 作者:未知  
  433. Array()
  434. 函数返回一个数组
  435. 表达式 Array(list)
  436. 允许数据类型: 字符,数字均可
  437. 实例: <%
  438. Dim myArray()
  439. For i = 1 to 7
  440. Redim Preserve myArray(i)
  441. myArray(i) = WeekdayName(i)
  442. Next
  443. %>
  444. 返回结果: 建立了一个包含7个元素的数组myArray
  445. myArray("Sunday","Monday", ... ... "Saturday")
  446. CInt()
  447. 函数将一个表达式转化为数字类型
  448. 表达式 CInt(expression)
  449. 允许数据类型: 任何有效的字符均可(不大于32767)
  450. 实例: <%
  451. f = "234"
  452. response.write cINT(f) + 2
  453. %>
  454. 返回结果: 236
  455. 转化字符"234"为数字"234",如果字符串为空,则返回0
  456.  
  457. CreateObject()
  458. 函数建立和返回一个已注册的ACTIVEX组件的实例。
  459. 表达式 CreateObject(objName)
  460. 允许数据类型: objName 是任何一个有效、已注册的ACTIVEX组件的名字.
  461. 实例: <%
  462. Set con = Server.CreateObject("ADODB.Connection")
  463. %>
  464.  
  465. CStr()
  466. 函数转化一个表达式为字符串.
  467. 表达式 CStr(expression)
  468. 允许数据类型: expression 是任何有效的表达式。
  469. 实例: <%
  470. s = 3 + 2
  471. response.write "The 返回结果 is: " & cStr(s)
  472. %>
  473. 返回结果: 转化数字“5”为字符“5”。
  474.  
  475. Date()
  476. 函数返回当前系统日期.
  477. 表达式 Date()
  478. 允许数据类型: None.
  479. 实例: <%=Date%>
  480. 返回结果: 9/9/00
  481.  
  482. DateAdd()
  483. 函数返回一个被改变了的日期。
  484. 表达式 DateAdd(timeinterval,number,date)
  485. 允许数据类型:
  486. timeinterval is the time interval to add;
  487. number is amount of time intervals to add;
  488. and date is the starting date.
  489. 实例: <%
  490. currentDate = #9/9/00#
  491. newDate = DateAdd("m",3,currentDate)
  492. response.write newDate
  493. %>
  494. <%
  495. currentDate = #12:34:45 PM#
  496. newDate = DateAdd("h",3,currentDate)
  497. response.write newDate
  498. %>
  499. 返回结果: 9/9/00
  500. 3:34:45 PM
  501. "m" = "month";
  502. "d" = "day";
  503. If currentDate is in time format then,
  504. "h" = "hour";
  505. "s" = "second";
  506.  
  507. DateDiff()
  508. 函数返回两个日期之间的差值
  509. 表达式 DateDiff(timeinterval,date1,date2 [, firstdayofweek [, firstweekofyear]])
  510. 允许数据类型: timeinterval 表示相隔时间的类型,如“M“表示“月”。
  511. 实例: <%
  512. fromDate = #9/9/00#
  513. toDate = #1/1/2000#
  514. response.write "There are " & _
  515. DateDiff("d",fromDate,toDate) & _
  516. " days to millenium from 9/9/00."
  517. %>
  518. 返回结果: 9/9/00 2000年还有 150 天.
  519.  
  520. Day()
  521. 函数返回一个月的第几日 .
  522. 表达式 Day(date)
  523. 允许数据类型: date 是任何有效的日期。
  524. 实例: <%=Day(#9/9/00#)%>
  525. 返回结果: 9
  526.  
  527. formatCurrency()
  528. 函数返回表达式,此表达式已被格式化为货币值
  529. 表达式 formatCurrency(Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]])
  530. 允许数据类型: Digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置; LeadingDigit 三态常数,指示是否显示小数值小数点前面的零。
  531. 实例: <%=formatCurrency(34.3456)%>
  532. 返回结果: $34.35
  533.  
  534. formatDateTime()
  535. 函数返回表达式,此表达式已被格式化为日期或时间
  536. 表达式 formatDateTime(Date, [, Namedformat])
  537. 允许数据类型: Namedformat 指示所使用的日期/时间格式的数值,如果省略,则使用 vbGeneralDate.
  538. 实例: <%=formatDateTime("09/9/00", vbLongDate)%>
  539. 返回结果: Sunday, September 09, 2000
  540.  
  541. formatNumber()
  542. 函数返回表达式,此表达式已被格式化为数值.
  543. 表达式 formatNumber(Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]])
  544. 允许数据类型: Digit 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。; LeadingDigit i指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。; Paren 指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。; GroupDigit i指示小数点右侧显示位数的数值。默认值为 -1,指示使用的是计算机的区域设置。.
  545. 实例: <%=formatNumber(45.324567, 3)%>
  546. 返回结果: 45.325
  547.  
  548. formatPercent()
  549. 函数返回表达式,此表达式已被格式化为尾随有 % 符号的百分比(乘以 100 )。 (%)
  550. 表达式 formatPercent(Expression [, Digit [, LeadingDigit [, Paren [, GroupDigit]]]])
  551. 允许数据类型: 同上.
  552. 实例: <%=formatPercent(0.45267, 3)%>
  553. 返回结果: 45.267%
  554.  
  555. Hour()
  556. 函数以24时返回小时数.
  557. 表达式 Hour(time)
  558. 允许数据类型:
  559. 实例: <%=Hour(#4:45:34 PM#)%>
  560. 返回结果: 16
  561. (Hour has been converted to 24-hour system)
  562.  
  563. Instr()
  564. 函数返回字符或字符串在另一个字符串中第一次出现的位置.
  565. 表达式 Instr([start, ] strToBeSearched, strSearchFor [, compare])
  566. 允许数据类型: Start为搜索的起始值,strToBeSearched接受搜索的字符串 strSearchFor要搜索的字符.compare比较方式(详细见ASP常数)
  567. 实例: <%
  568. strText = "This is a test!!"
  569. pos = Instr(strText, "a")
  570. response.write pos
  571. %>
  572. 返回结果: 9
  573.  
  574. InstrRev()
  575. 函数同上,只是从字符串的最后一个搜索起
  576. 表达式 InstrRev([start, ] strToBeSearched, strSearchFor [, compare])
  577. 允许数据类型: 同上.
  578. 实例: <%
  579. strText = "This is a test!!"
  580. pos = InstrRev(strText, "s")
  581. response.write pos
  582. %>
  583. 返回结果: 13
  584.  
  585. Int()
  586. 函数返回数值类型,不四舍五入。
  587. 表达式 Int(number)
  588. 允许数据类型:
  589. 实例: <%=INT(32.89)%>
  590. 返回结果: 32
  591.  
  592. IsArray()
  593. 函数判断一对象是否为数组,返回布尔值 .
  594. 表达式 IsArray(name)
  595. 实例: <%
  596. strTest = "Test!"
  597. response.write IsArray(strTest)
  598. %>
  599. 返回结果: False
  600.  
  601. IsDate()
  602. 函数判断一对象是否为日期,返回布尔值
  603. 表达式 IsDate(expression)
  604. 实例: <%
  605. strTest = "9/4/2000"
  606. response.write IsDate(strTest)
  607. %>
  608. 返回结果: True
  609.  
  610. IsEmpty()
  611. 函数判断一对象是否初始化,返回布尔值.
  612. 表达式 IsEmpty(expression)
  613. 实例: <%
  614. Dim i
  615. response.write IsEmpty(i)
  616. %>
  617. 返回结果: True
  618.  
  619. IsNull()
  620. 函数判断一对象是否为空,返回布尔值.
  621. 表达式 IsNull(expression)
  622. 实例: <%
  623. Dim i
  624. response.write IsNull(i)
  625. %>
  626. 返回结果: False
  627.  
  628. IsNumeric()
  629. 函数判断一对象是否为数字,返回布尔值.
  630. 表达式 IsNumeric(expression)
  631. 实例: <%
  632. i = "345"
  633. response.write IsNumeric(i)
  634. %>
  635. 返回结果: True
  636. 就算数字加了引号,ASP还是认为它是数字。
  637.  
  638. IsObject()
  639. 函数判断一对象是否为对象,返回布尔值.
  640. 表达式 IsObject(expression)
  641. 实例: <%
  642. Set con = Server.CreateObject("ADODB.Connection")
  643. response.write IsObject(con)
  644. %>
  645. 返回结果: True
  646.  
  647. LBound()
  648. 函数返回指定数组维的最小可用下标.
  649. 表达式 Lbound(arrayname [, dimension])
  650. 实例: <%
  651. i = Array("Monday","Tuesday","Wednesday")
  652. response.write LBound(i)
  653. %>
  654. 返回结果: 0
  655.  
  656. LCase()
  657. 函数 返回字符串的小写形式
  658. 表达式 Lcase(string)
  659. 实例: <%
  660. strTest = "This is a test!"
  661. response.write LCase(strTest)
  662. %>
  663. 返回结果: this is a test!
  664.  
  665. Left()
  666. 函数返回字符串左边第length个字符以前的字符(含第length个字符).
  667. 表达式 Left(string, length)
  668. 实例: <%
  669. strTest = "This is a test!"
  670. response.write Left(strTest, 3)
  671. %>
  672. 返回结果: Thi
  673.  
  674. Len()
  675. 函数返回字符串的长度.
  676. 表达式 Len(string | varName)
  677. 实例: <%
  678. strTest = "This is a test!"
  679. response.write Len(strTest)
  680. %>
  681. 返回结果: 15
  682.  
  683. LTrim()
  684. 函数去掉字符串左边的空格.
  685. 表达式 LTrim(string)
  686. 实例: <%
  687. strTest = " This is a test!"
  688. response.write LTrim(strTest)
  689. %>
  690. 返回结果: This is a test!
  691.  
  692. Mid()
  693. 函数返回特定长度的字符串(从start开始,长度为length).
  694. 表达式 Mid(string, start [, length])
  695. 实例: <%
  696. strTest = "This is a test! Today is Monday."
  697. response.write Mid(strTest, 17, 5)
  698. %>
  699. 返回结果: Today
  700.  
  701. Minute()
  702. 函数返回时间的分钟.
  703. 表达式 Minute(time)
  704. 实例: <%=Minute(#12:45:32 PM#)%>
  705. 返回结果: 45
  706.  
  707. Month()
  708. 函数返回日期.
  709. 表达式 Month(date)
  710. 实例: <%=Month(#08/04/99#)%>
  711. 返回结果: 8
  712.  
  713. MonthName()
  714. 函数返回指定月份
  715. 表达式 MonthName(month, [, Abb])
  716. 实例: <%=MonthName(Month(#08/04/99#))%>
  717. 返回结果: August
  718.  
  719. Now()
  720. 函数返回系统时间
  721. 表达式 Now()
  722. 实例: <%=Now%>
  723. 返回结果: 9/9/00 9:30:16 AM
  724.  
  725. Right()
  726. 函数返回字符串右边第length个字符以前的字符(含第length个字符).
  727. 表达式 Right(string, length)
  728. 实例: <%
  729. strTest = "This is an test!"
  730. response.write Right(strTest, 3)
  731. %>
  732. 返回结果: st!
  733.  
  734. Rnd()
  735. 函数产生一个随机数.
  736. 表达式 Rnd [ (number) ]
  737. 实例: <%
  738. Randomize()
  739. response.write RND()
  740. %>
  741. 返回结果: 任何一个在0 1 之间的数
  742.  
  743. Round()
  744. 函数返回按指定位数进行四舍五入的数值.
  745. 表达式 Round(expression [, numRight])
  746. 实例: <%
  747. i = 32.45678
  748. response.write Round(i)
  749. %>
  750. 返回结果: 32
  751.  
  752. Rtrim()
  753. 函数去掉字符串右边的字符串.
  754. 表达式 Rtrim(string)
  755. 实例: <%
  756. strTest = "This is a test!! "
  757. response.write RTrim(strTest)
  758. %>
  759. 返回结果: This is a test!!
  760.  
  761. Split()
  762. 函数将一个字符串分割并返回分割结果
  763. 表达式 Split (S[,d])
  764. 实例:<%V= Split(A,B,C)
  765. For i = 0 To UBound(V)
  766. Response.Write V(i)
  767. Next
  768. %>
  769. 返回结果: A B C
  770.  
  771. Second()
  772. 函数返回秒.
  773. 表达式 Second(time)
  774. 实例: <%=Second(#12:34:28 PM#)%>
  775. 返回结果: 28
  776.  
  777. StrReverse()
  778. 函数反排一字符串
  779. 表达式 StrReverse(string)
  780. 实例: <%
  781. strTest = "This is a test!!"
  782. response.write StrReverse(strTest)
  783. %>
  784. 返回结果: !!tset a si sihT
  785.  
  786. Time()
  787. 函数返回系统时间.
  788. 表达式 Time()
  789. 实例: <%=Time%>
  790. 返回结果: 9:58:28 AM
  791.  
  792. Trim()
  793. 函数去掉字符串左右的空格.
  794. 表达式 Trim(string)
  795. 实例: <%
  796. strTest = " This is a test!! "
  797. response.write Trim(strTest)
  798. %>
  799. 返回结果: This is a test!!
  800.  
  801. UBound()
  802. 函数返回指定数组维数的最大可用下标>.
  803. 表达式 Ubound(arrayname [, dimension])
  804. 实例: <%
  805. i = Array("Monday","Tuesday","Wednesday")
  806. response.write UBound(i)
  807. %>
  808. 返回结果: 2
  809.  
  810. UCase()
  811. 函数返回字符串的大写形式.
  812. 表达式 UCase(string)
  813. 允许数据类型:
  814. 实例: <%
  815. strTest = "This is a test!!"
  816. response.write UCase(strTest)
  817. %>
  818. 返回结果: THIS IS A TEST!!
  819.  
  820. VarType()
  821. 函数返回指示变量子类型的值
  822. 表达式 VarType(varName)
  823. 实例: <%
  824. i = 3
  825. response.write varType(i)
  826. %>
  827. 返回结果: 2(数字)详见"asp常数"
  828.  
  829. WeekDay()
  830. 函数返回在一周的第几天.
  831. 表达式 WeekDay(date [, firstdayofweek])
  832. 实例: <%
  833. d = #9/9/00#
  834. response.write Weekday(d)
  835. %>
  836. 返回结果: 4(星期三)
  837.  
  838. WeekDayName()
  839. 函数返回一周第几天的名字.
  840. 表达式 WeekDayName(weekday [, Abb [, firstdayofweek]])
  841. 实例: <%
  842. d = #9/9/00#
  843. response.write WeekdayName(Weekday(d))
  844. %>
  845. 返回结果: Wednesday
  846.  
  847. Year()
  848. 函数返回当前的年份.
  849. 表达式 Year(date)
  850. 实例: <%=Year(#9/9/00#)%>
  851. 返回结果: 1999

  

ASP常用函数表的更多相关文章

  1. Makefile 常用函数表

    Makefile  常用函数表 一.字符串处理函数1.$(subst FROM,TO,TEXT)函数名称:字符串替换函数—subst.函数功能:把字串“TEXT”中的“FROM”字符替换为“TO”.返 ...

  2. asp.net常用函数表

    文章转载于[IT花园]:http://www.itgarden.com.cn/showtopic-29.aspx Abs(number) 取得数值的绝对值. Asc(String) 取得字符串表达式的 ...

  3. C++ 虚函数表解析

    转载:陈皓 http://blog.csdn.net/haoel 前言 C++中 的虚函数的作用主要是实现了多态的机制.关于多态,简而言之就是用父类型别的指针指向其子类的实例,然后通过父类的指针调用实 ...

  4. C++ 多态、虚函数机制以及虚函数表

    1.非virtual函数,调用规则取决于对象的显式类型.例如 A* a  = new B(); a->display(); 调用的就是A类中定义的display().和对象本体是B无关系. 2. ...

  5. C++迟后联编和虚函数表

    先看一个题目: class Base { public: virtual void Show(int x) { cout << "In Base class, int x = & ...

  6. C++ 知道虚函数表的存在

    今天翻看陈皓大大的博客,直接找关于C++的东东,看到了虚函数表的内容,找一些能看得懂的地方记下笔记. 0 引子 类中存在虚函数,就会存在虚函数表,在vs2015的实现中,它存在于类的头部. 假设有如下 ...

  7. C++虚函数和虚函数表

    前导 在上面的博文中描述了基类中存在虚函数时,基类和派生类中虚函数表的结构. 在派生类也定义了虚函数时,函数表又是怎样的结构呢? 先看下面的示例代码: #include <iostream> ...

  8. C++ Daily 《5》----虚函数表的共享问题

    问题: 包含一个以上虚函数的 class B, 它所定义的 对象是否共用一个虚函数表? 分析: 由于含有虚函数,因此对象内存包含了一个指向虚函数表的指针,但是这个指针指向的是同一个虚函数表吗? 实验如 ...

  9. C++虚函数表

    大家知道虚函数是通过一张虚函数表来实现的.在这个表中,主要是一个类的虚函数的地址表,这张表解决了继承.覆盖的问题,其内容真是反应实际的函数.这样,在有虚函数的类的实例中,这个表分配在了这个实例的内存中 ...

随机推荐

  1. 绑定线程到特定CPU处理器

    参考这篇文章 http://blog.chinaunix.net/uid-27761170-id-5050258.html 代码如下: #define _GNU_SOURCE #include < ...

  2. 使用PUT方法上传文件无法工作原因分析

    现象 在Spring Framework中,使用HTTP的PUT方法上传文件时,在服务器端发现Multipart参数为空. 原因 Spring中的StandardServletMultipartRes ...

  3. 改变Oracle数据库连接端口

    Oracle数据库默认数据库监听与连接端口是1521, 但是有时候项目中需要更改默认端口 这样做很多时候客户要求,基于安全考虑. 以Oracle 11g 为例, 更改Listener的端口大致 需要以 ...

  4. 得到内网域管理员的5种常见方法<转>

    1.Netbios and LLMNR Name Poisoning 这个方法在WIN工作组下渗透很有用,WIN的请求查询顺序是下面三个步骤:本地hosts文件(%windir%\System32\d ...

  5. 改变UIView 的位置 Center和Frame

    网上找了一个,一般来说 有两种方法: 1.改变view 的Frame [cell setFrame:CGRectMake(<#CGFloat x#>, <#CGFloat y#> ...

  6. Mouse_event 鼠标点击

    //这样就是左键单击 mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );// 按下mouse_event( MOUSEEVENTF_LEFTUP, 0, ...

  7. MySQL Router 测试使用 转

    MySQL Router 测试使用 . 特性 MySQL Router 并没有包括一些特别新的特性, 总体上看中规中矩, 不过 first-available 和插件两个特性挺有意思, 后续会进行讲解 ...

  8. [原创,分享]DbHelper 续

    一直在想怎么样才能让dbHelper更简单,更灵活,更僵化.终于我发布了第一个开源版本的dbhelper.此helper将使用System.Data.DbHelper作为命名空间.采用内部驱动与内容S ...

  9. 【ZZ】如何选择适合自己项目的编程语言

    http://news.cnblogs.com/n/506473/ 与操作系统一样,在办公室软件套装和计算机中也具有各种计算机语言.存在这种多样性的原因与其它地方的多样性一样—-因为没有单一的解决方法 ...

  10. 不安装oracle客户端也可以使用pl/sql developer

    通常情况下,用PL/SQL Developer连接Oracle是需要安装Oracle客户端软件的,这也就意味着你的硬盘将被占用大约1G-2G的空间,对于Windows操作系统来说,你还会多出一些开机自 ...