Methods for invoking strings:
var s= "Hello, World";
document.write (S.charat (0)); First character
document.write (S.charat (s.length-1)); Last character
document.write (s.substring (1,4)); 2nd to 4th character
document.write (S.slice (-3)); Last 3 character (s)
document.write (S.indexof ("L")); Position of the first occurrence of the character L
document.write (S.lastindexof ("L")); The position of the last occurrence of the character L
document.write (S.indexof ("L", 3)); Position of the character L for the first occurrence after position 3 and after
document.write (S.split (",")); Use, Separate strings
document.write (S.replace ("H", "H")); Full-text character substitution
document.write (S.touppercase ()); Replace with uppercase
In addition to using the Charat () method, you can access a single character in a string by [].
S= "Hello,world";
S[0]; First character
s[s.length-1];//last character
One of the JS summaries: How to invoke a string