20. Function month()
Function: Return a value, representing the month
Format: month(time)
Parameter: time is a date variable
Example <%=month(#08/09/99)%>
Results: 9
21. Function monthname()
Function: Return the string (name) of the month.
Format: Monthname(date [,abb])
Parameters: date is a date variable, when abb=true, the abbreviation of the month,
example:
<% =monthname(#4/5/99#) %>
Results: April
22. Function Now()
Function: Return the current time and date of the system.
Format: now()
Parameters: None
example:
<% =now() %>
Results: 05/10/00 8:45:32 pm
23. Function: replace()
Function: Search in strings, instead of the specified string.
Format: replace(strtobesearched,strsearchfor,strreplacewith[,start[,count[,compare]]])
Parameters: strtobesearched is a string; strsearchfor is the substring being searched; strreplacewith is the substring used to replace. start, count, compare is any option.
example:
<%
strtest="this is an apple."
replace(strtest,"apple","orange")
%>
Result: this is an orange.
24. Function right()
Function: Intercept the latter part of a string
Format: right(string, length)
Parameters: string string, length intercepted by length.
example:
<%
strtest="this is a test!"
right(strtest,3)
%>
Result: st!
25. Function rnd()
Function: Return a random value
Format:rnd[(number)]
Parameter: number is any numerical value.
example:
<%
randomize()
rnd()
%>
Result: If one of the 0/1 values is one of the values, without randomize(), random numbers cannot be generated.
26. Function round()
Function: Complete value
Format: round(expression[,numright])
Parameters: expression numeric expression; numright arbitrary options.
example:
<%
i=12.33654
round(i)
%>
Results: 12
27. Function rtrim()
Function: Remove the spaces after the string.
Format: rtrim(string)
Parameters: string is a string
example:
<%
rtrim("this is a test! ")
%>
Result: this is a test!
28. Function second()
Function: Return an integer value.
Format: second(time)
Parameter: time is a valid time expression;
Example lt;%=second(# 12:28:30#) %>
Results: 30
29. Function strReverse()
Function: Return a string in reverse direction from the original string arrangement.
Format:strreverse(string)
Parameter: string is a string
Example <%=strreverse("this is"a test!")
Result:!tset a si siht
30. Function time()
Function: Return the time value of the current system.
Format: time()
Parameters: None
Result: 9:58:28 Am
31. Function trim()
Function: Delete the spaces before and after the string.
Format:trim(string)
Parameters: string string.
example:
<%
strtest=" this is a test! "
trim(strtest)
%>
Result: this is a test!
32. Function UBound()
Function: Return the upper bound of an array.
Format: Ubound(expression [, dimension])
Parameters: expression is an array expression/array variable, dimension is any item
example:
<%
i = array("1","2","3")
ubound(i)
%>
Results: 2
33. Function: UCase()
Function: Convert all characters of a character type variable into capital characters.
Format: Ucase(string)
Parameter: string is a string variable
example:
<%
str="THIS is Lcase!"
Lcase(str)
%>
Result: THIS IS LCASE!
34. Function Vartype()
Function: Return the constant code of the variable (integral)
Format: Vartype(varname)
Parameter: varname is a variable name of any type.
example:
<%
i=5
vartype(i)
%>
Result: 2 (2 represents an integer, you need to refer to the ASP constant code.)
35. Function Weekday()
Function: Return an integer, corresponding to the day of the week.
Format: Weekday(date [,firstofweek])
Parameters: date is a date variable, firstofweek is any option.
example:
<%
d= # 5/9/00 #
weekday(d) %>
Result: 3 (3 means Tuesday)
36. Function weekdayname()
Function: Returns the string, corresponding to the day of the week.
Format: weekdayname(weekday[,abb[,firstdayofweek]])
Parameters: weekday is the date variable, abb, firstdayofweek is any option.
example:
<%
d = #8/4/99#
weekdayname(d)
%>
Results: Wednesday
37. Function year()
Function: Returns the year where the date expression is located.
Format: year(date)
Parameters: date is a valid date expression
example:
<% =year(#8/9/99#) %>
Result: 1999
38. Function Mod() function: take the remainder.
Example: 3 Mod 2
Results: 1
Let me first introduce the usage of the Split function:
Return value array = Split("String", "Split")
Application of functions
Author: Li Chunguang Reposted from: Original of this site. Number of clicks: 113. Article entry:
split is a function that separates strings. Its function is to convert strings separated by specific separators into an array. This is used more frequently in programming. For example, if multiple images are uploaded and only one field can be stored in the database, split works. The following is a specific example, used in combination with arrays.
<%
dim str1
str1="icerain|fengling|windbell|"
aryReturn=split(str1,"|")
"Is the returned array"&IsArray(aryReturn)
"<br>"
for i=LBound(aryReturn) TO UBound(aryReturn)
aryReturn(i)
"<br>"
next
%>
Rnd()
The function generates a random number.
Expression Rnd [ (number) ]
Example: <%
Randomize()
RND()
%>
Return result: Any number between 0 and 1