Javascript Strings

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Created page with "Although the String object is not directly supported by Yate's Javascript these methods are applicable to most non-object variables. Note that these are not real properties o...")
 
Line 5: Line 5:
 
* <div id="length">'''length'''</div>
 
* <div id="length">'''length'''</div>
 
Property that describes the length of a string as a decimal number.
 
Property that describes the length of a string as a decimal number.
 +
 +
* <div id="charAt">'''charAt(pos)'''<div>
 +
Function that returns a character at a certain position in string.
 +
 +
* <div id="indexOf">'''indexOf(str)'''</div>
 +
Function that returns the position of a substring in another string.
 +
 +
* <div id="substr">'''substr(offs,len)'''</div>
 +
Function that returns a substring.
 +
 +
* '''substr(offs)'''
 +
Function that returns a substring.
 +
 +
* <div id="match">'''match(reg)'''</div>
 +
Function that matches a string against a Regular Expression.
 +
 +
* <div id="toLowerCase">'''toLowerCase()'''</div>
 +
Function that converts a string to lower case.
 +
 +
* <div id="toUpperCase">'''toUpperCase()'''</div>
 +
Function that converts a string to upper case.
 +
 +
* <div id="trim">'''trim()'''</div>
 +
Function that removes leading and trailing spaces from a string.
 +
 +
* <div id="sqlEscape">'''sqlEscape()'''</div>
 +
Function that performs SQL escaping on a string.
 +
 +
* <div id="startsWith">'''startsWith(str)'''</div>
 +
Function that checks if a string starts with a specific substring.
 +
 +
* <div id="endsWith">'''endsWith(str)'''</div>
 +
Function that checks if a string ends with a specific substring.
 +
 +
* <div id="split">'''split(sep)'''</div>
 +
Function that splits a string into an Array at a separator.
 +
 +
* <div id="toString">'''toString()'''</div>
 +
Function that converts a number to string using numbering base 10.
 +
 +
* '''toString(base)'''
 +
Function that converts a number to string using a specified numbering base.

Revision as of 17:02, 10 September 2013

Although the String object is not directly supported by Yate's Javascript these methods are applicable to most non-object variables.

Note that these are not real properties of strings and cannot be enumerated!

  • length

Property that describes the length of a string as a decimal number.

  • charAt(pos)

Function that returns a character at a certain position in string.

  • indexOf(str)

Function that returns the position of a substring in another string.

  • substr(offs,len)

Function that returns a substring.

  • substr(offs)

Function that returns a substring.

  • match(reg)

Function that matches a string against a Regular Expression.

  • toLowerCase()

Function that converts a string to lower case.

  • toUpperCase()

Function that converts a string to upper case.

  • trim()

Function that removes leading and trailing spaces from a string.

  • sqlEscape()

Function that performs SQL escaping on a string.

  • startsWith(str)

Function that checks if a string starts with a specific substring.

  • endsWith(str)

Function that checks if a string ends with a specific substring.

  • split(sep)

Function that splits a string into an Array at a separator.

  • toString()

Function that converts a number to string using numbering base 10.

  • toString(base)
Function that converts a number to string using a specified numbering base.
Retrieved from "https://docs.yate.ro/wiki/index.php?title=Javascript_Strings&oldid=6843"
Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers