Object String Function

What are the methods of string object in javascript?


An object is nothing but a class or file with a group of functions or methods. In javascript strings are stored as string objects. We can declare a string in either of the two ways
a) var sname = "testing string object";
b) var sname = new String("testing string object");
Both results in the same string object. String object contains some predefined function or methods that are extensively used in javascript.
String object has the following functions
a) length()
b) charAt()
c) indexOf()
d) lastIndexOf()
e) substring()
f) split()
g) toLowerCase()
h) toUpperCase()

Ask Questions

Ask Question