ASP实用函数库(5)

函数

    Len()
   FUNCTION: 返回字符串的长度.
   SYNTAX: Len(string | varName)
   ARGUMENTS: 
   EXAMPLE: <%
  strTest = "This is a test!"
  response.write Len(strTest)
  %>
   RESULT: 15
   
  LTrim()
   FUNCTION: 去掉字符串左边的空格.
   SYNTAX: LTrim(string)
   ARGUMENTS: 
   EXAMPLE: <%
  strTest = " This is a test!"
  response.write LTrim(strTest)
  %>
   RESULT: This is a test!
   
  Mid()
   FUNCTION: 返回特定长度的字符串(从start开始,长度为length).
   SYNTAX: Mid(string, start [, length])
   ARGUMENTS: 
   EXAMPLE: <%
  strTest = "This is a test! Today is Monday."
  response.write Mid(strTest, 17, 5)
  %>
   RESULT: Today
   
  Minute()
   FUNCTION: 返回时间的分钏.
   SYNTAX: Minute(time)
   ARGUMENTS: 
   EXAMPLE: <%=Minute(#12:45:32 PM#)%>
   RESULT: 45

    Month()
   FUNCTION: 返回日期.
   SYNTAX: Month(date)
   ARGUMENTS: date is any valid date expression.
   EXAMPLE: <%=Month(#08/04/99#)%>
   RESULT: 8
   
  MonthName()
   FUNCTION: Returns a string identifying the specified month.
   SYNTAX: MonthName(month, [, Abb])
   ARGUMENTS: month is the numeric representation for a given month; Abb
  (optional) is a boolean value used to display month abbreviation. True
  will display the abbreviated month name and False (default) will not show
  the abbreviation.
   EXAMPLE: <%=MonthName(Month(#08/04/99#))%>
   RESULT: August
   
  Now()
   FUNCTION: Returns the current system date and time.
   SYNTAX: Now()
   ARGUMENTS: None
   EXAMPLE: <%=Now%>
   RESULT: 8/4/99 9:30:16 AM
   
  Replace()
   FUNCTION: Returns a string in which a specified sub-string has been
  replaced with another substring a specified number of times.
   SYNTAX: Replace(strToBeSearched, strSearchFor, strReplaceWith [, start
  ][, count ][, compare]]])
   ARGUMENTS: strToBeSearched is a string expression containing a sub-
  string to be replaced; strSearchFor is the string expression to search for
  within strToBeSearched; strReplaceWith is the string expression to replace
  sub-string strSearchFor; start (optional) is the numeric character
  position to begin search; count (optional) is a value indicating the
  comparision constant.
   EXAMPLE: <%
  strTest = "This is an apple!"
  response.write Replace(strTest, "apple", "orange")
  %>
   RESULT: This is an orange!

时间: 2024-12-03 20:58:42

ASP实用函数库(5)的相关文章

ASP实用函数库(3)

函数    FormatCurrency()    FUNCTION: 返回表达式,此表达式已被格式化为货币值    SYNTAX: FormatCurrency(Expression [, Digit ][, LeadingDigit ][, Paren ][,   GroupDigit]]]])    ARGUMENTS: Digit 指示小数点右侧显示位数的数值.默认值为 -1,指示使用的是   计算机的区域设置; LeadingDigit 三态常数,指示是否显示小数值小数点前面的   零

ASP实用函数库(4)

函数    IsDate()    FUNCTION: 判断一对象是否为日期,返回布尔值    SYNTAX: IsDate(expression)    ARGUMENTS: expression is any valid expression.    EXAMPLE: <%   strTest = "8/4/99"   response.write IsDate(strTest)   %>    RESULT: True      IsEmpty()    FUNCTI

ASP实用函数库(6)

函数    Right()    FUNCTION: 返回字符串右边第length个字符以前的字符(含第length个字符).    SYNTAX: Right(string, length)    ARGUMENTS: .    EXAMPLE: <%   strTest = "This is an test!"   response.write Right(strTest, 3)   %>    RESULT: st!      Rnd()    FUNCTION: 产

ASP实用函数库(1)

函数    <%   '判断文件名是否合法   Function isFilename(aFilename)    Dim sErrorStr,iNameLength,i    isFilename=TRUE    sErrorStr=Array("/","\",":","*","?","""","<",">"

ASP实用函数库(2)

函数  Array()    FUNCTION: 返回一个数组    SYNTAX: Array(list)    ARGUMENTS: 字符,数字均可    EXAMPLE: <%   Dim myArray()   For i = 1 to 7    Redim Preserve myArray(i)    myArray(i) = WeekdayName(i)   Next   %>    RESULT: 建立了一个包含7个元素的数组myArray   myArray("Sun

ASP实用函数库源码(一)

下面的代码是我最近正在整理的常用代码的一部分,陆续我将放出更多的实用代码,请大家把自己的代码回复,一边我整理,谢谢!QQ:393356<%'判断文件名是否合法Function isFilename(aFilename) Dim sErrorStr,iNameLength,i isFilename=TRUE sErrorStr=Array("/","",":","*","?",""&

ASP实用函数库

<%'判断文件名是否合法Function isFilename(aFilename) Dim sErrorStr,iNameLength,i isFilename=TRUE sErrorStr=Array("/","\",":","*","?","""","<",">","|") iName

动态网页技术:ASP函数库

动态|函数|网页 ASP函数库<%''''                   函数目录                    ''''''''-----------------------------------------------'''''''' 函数ID:0001[截字符串]                        '''''''' 函数ID:0002[过滤html]                        '''''''' 函数ID:0003[打开任意数据表并显示表结构及

原创的ASP文件上传函数库,比动网、amao的都差了很多,不过是学习的好资料

原创的ASP文件上传函数库,比动网.amao的都差了很多,不过是学习的好资料 54powerman 说明:如果你需要file表单的串值,用GetFullName("file")如果需要file表单的文件名,用GetFileName("file")如果需要file表单的扩展名,用GetExtName("file")如果需要普通文本表单的值,用MyRequest("password")如果需要file表单的二进制值,也是用MyRe