String object
The string object provides many methods for operating the string content.
Attribute
Length: the number of characters in the string.
Method
Big (), blink (), bold (), fixed (), italics (), small (), sub (), strike (), sup (), fontcolor (color), fontsize (size)
The above method adds the corresponding HTML tag for the string.
Charat (INDEX) returns the character at index in the string.
Indexof (searchvalue, [fromindex]) This method searches for the first searchvalue in the string. if fromindex is specified, the search starts from the position in the string. When the searchvalue is found, the position of the first character of the string is returned.
Lastindexof (searchvalue, [fromindex]) Searches the searchvalue forward from the end of the string and reports the First Instance found.
Substring (Indexa, indexb) obtains the substring from Indexa to indexb.
Tolowercase (), touppercase () converts all characters in the string to uppercase and lowercase.
Date object
To use the date object, you must first create a date instance:
Variable name = new date ();
Method
Getday (), getdate (), gethours (), getminutes (), getmonth (), getseconds (), gettime (), gettimezoneoffset (), getyear ()
And setday ......
Togmtstring () returns the current time in GMT format. (Sun, 12 Feb 1999 14:19:22 GMT)
Tolocalestring returns the current time in locale Format. (03/11/99 14:19:22)
Parse (date) converts a normal date string into a haoss format, and then sets a parameter for settime.
Math object
Attribute
Ln10 (natural logarithm of 10)
Pi (1415926 ...)
Sqrt1_2 (square root of 1/2)
Method
ABS (x) returns the absolute value of X.
ACOs (x) returns the arc cosine value of X.
Asin (x) returns the arc sin value of X.
Atan (x) returns the arc tangent value of X.
Ceil (x) returns the smallest integer greater than or equal to X.
Cos (x) returns the cosine value of X.
Exp (x) returns the X power of E.
Floor (x) returns the largest integer less than or equal to X.
Log (x) returns X's
Max (x, y) returns values in X, Y.
Min (x, y) returns a small value in X and Y.
Pow (x, y) returns the yth power of X.
Round (X) to the nearest integer (rounded off if it is less than or equal to 0.5 decimal places)
Sin (x) returns the sin value of X.
SQRT (x) returns the square root of X.
Tan (x) returns the tangent value of X.