ASP Functional Library (5)

Source: Internet
Author: User
Tags date count expression numeric month name
Function

    Len ()
   FUNCTION: Returns the length of a string.
   Syntax:len (String | varName)
   ARGUMENTS:
   EXAMPLE: <%
 &nb Sp;strtest = "This is a test!"
  response.write Len (strtest)
  %>
   result:15
  
& Nbsp; ltrim ()
   FUNCTION: Removes the space on the left side of the string.
   Syntax:ltrim (String)
   ARGUMENTS:
   EXAMPLE: <%
   Strtest = "This is a test!"
  response.write LTrim (strtest)
  %>
   Result:this is a test!
  
  mid ()
   FUNCTION: Returns a string of a specific length, from start to length.
   Syntax:mid (String, start [, length])
   ARGUMENTS:
   EXAMPLE: <%
&N Bsp; strtest = "This is a test! The Today is Monday.
  response.write Mid (strtest, 5)
  %>
   result:today
  
  minute ()
   FUNCTION: Returns the minute Kushiro of the time.
   Syntax:minute (time)
   ARGUMENTS:
   EXAMPLE: <%=minute (#12:45:32 pm# )%>
   result:45

Month ()


FUNCTION: Returns a date.


syntax:month (date)


Arguments:date is any valid date expression.


EXAMPLE: &lt;%=month (#08/04/99#)%&gt;


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


'll display the abbreviated month name and False (default) won't show


the abbreviation.


EXAMPLE: &lt;%=monthname (Month (#08/04/99#))%&gt;


Result:august


 


Now ()


Function:returns the current system date and time.


Syntax:now ()


Arguments:none


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


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.


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: &lt;%


strtest = "This is a apple!"


Response.Write Replace (strtest, "Apple", "orange")


%&gt;


Result:this is a orange!







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.