ASP Functional Library (6)

Source: Internet
Author: User
Tags date array expression integer rtrim trim
Function

   Right ()
   FUNCTION: Returns the previous character (with length characters) of the length character to the right of the string.
   syntax:right (string, length)
   ARGUMENTS:.
   EXAMPLE: <%
  strtest = "This is a test!"
  response.write Right (strtest, 3)
  %>
   result:st!
  
  rnd ()
   FUNCTION: Produces a random number.
   Syntax:rnd [(number)]
   ARGUMENTS:
   EXAMPLE: <%
  ran Domize ()
  response.write RND ()
  %>
   Result: Any number between 0 and 1
 &  nbsp
  round ()
   FUNCTION: Returns a value that is rounded by a specified number of digits.
   syntax:round (expression [, numright])
   arguments:numright number indicates how many digits to the right of the decimal point are rounded. If omitted, the
  round function returns an integer.
   EXAMPLE: <%
  i = 32.45678
  response.write Round (i)
 &nbsP;%>
   result:32
  
  rtrim ()
   FUNCTION: Removes the string to the right of the string. br>   Syntax:rtrim (String)
   ARGUMENTS:
   EXAMPLE: <%
   Strtest = "This is a test!!"
  response.write RTrim (strtest)
  %>
   Result:this is a test!!
  
  second ()
   FUNCTION: Returns a second.
   Syntax:second (time)
   ARGUMENTS:.
   EXAMPLE: <%=second (#12:34:28 pm#)%>
   result:28
  
   strreverse ()
   FUNCTION: Reverse-Line A string
   syntax:strreverse (string)
   ARGUMENTS:
   EXAMPLE: <%
  strtest = "This is a test!!"
  response.write StrReverse (strtest)
  %>
   result:!! Tset a Si siht

Time ()


FUNCTION: Returns the system time.


syntax:time ()


ARGUMENTS:.


EXAMPLE: &lt;%=Time%&gt;


result:9:58:28 AM


 


Trim ()


FUNCTION: Remove the space around the string.


Syntax:trim (String)


arguments:string is any valid string expression.


EXAMPLE: &lt;%


strtest = "This is a test!!"


Response.Write Trim (strtest)


%&gt;


Result:this is a test!!


 


UBound ()


FUNCTION: Returns the maximum available subscript for the specified array dimension.


Syntax:ubound (Arrayname [, dimension])


ARGUMENTS:; Dimension (optional) specifies the integer that returns the upper bound of the dimension. 1 means the first


Dimension, 2 represents the second dimension, and so on. If the dimension argument is omitted, the default value is 1.


EXAMPLE: &lt;%


i = Array ("Monday", "Tuesday", "Wednesday")


Response.Write UBound (i)


%&gt;


Result:2


 


UCase ()


FUNCTION: Returns the uppercase form of a string.


syntax:ucase (String)


ARGUMENTS:


EXAMPLE: &lt;%


strtest = "This is a test!!"


Response.Write UCase (strtest)


%&gt;


Result:this is A test!!


 


VarType ()


FUNCTION: Returns a value indicating the variable quantum type


Syntax:vartype (VarName)


ARGUMENTS:


EXAMPLE: &lt;%


i = 3


Response.Write VarType (i)


%&gt;


result:2 (number) See "ASP constant"


 


Weekday ()


FUNCTION: Returns the day ordinal of a week.


syntax:weekday (date [, FirstDayOfWeek])


ARGUMENTS:.


EXAMPLE: &lt;%


d = #8/4/99#


Response.Write Weekday (d)


%&gt;


result:4 (Wednesday)


 


WeekdayName ()


FUNCTION: Returns the name of the day ordinal of a week.


Syntax:weekdayname (Weekday [, ABB] [, FirstDayOfWeek]])


Arguments:abb Optional. Boolean value that indicates whether the name of the day of the week is abbreviated. If the province


slightly, the default value is False, that is, the name of the day of the week is not abbreviated. FirstDayOfWeek specified the first day of the week


Numerical


EXAMPLE: &lt;%


d = #8/4/99#


Response.Write WeekdayName (Weekday (d))


%&gt;


Result:wednesday


 


year ()


FUNCTION: Returns the current year.


syntax:year (date)


ARGUMENTS:


EXAMPLE: &lt;%=year (#8/4/99#)%&gt;


result:1999







Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.