1.charAt()
Returns a string at the specified position (n)
var str="javascript is a very important language!" ; document.write(str.charAt(9))Copy the code
The output
2.charCodeAt()
Returns the Unicode encoding of the string at the specified position (n)
var str="javascript is a very important language!" ; document.write(str.charCodeAt(9))Copy the code
The output
3.indexOf()
Returns the position of a substring in a string
var str="javascript is a very important language!" ; document.write(str.indexOf("very"))Copy the code
The output
4.substring()
Extracts the character between two specified index numbers in a string.
var str="javascript is a very important language!" ; document.write(str.indexOf("very"))Copy the code
The output