Javascript Strings

From Yate Documentation
Revision as of 18:02, 10 September 2013 by Paulc (Talk | contribs)

Jump to: navigation, search

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