Method 1: Use the charAt method under the String object
The charAt() method returns the character at the specified position.
Please note that JavaScript does not have a character data type distinct from the string type, so the characters returned are strings of length 1
Method 2: Use the substr method under the String object
Thesubstr() method can extract the specified number of characters starting from the start subscript in the string.
Important: ECMAscript does not standardize this method and therefore discourages its use.
Important: In IE 4, the value of parameter start is invalid. In this BUG, start specifies the position of the 0th character. (www.jb51.net) This BUG has been corrected in later versions.
Method 3: Use the split method under the String object
The split() method is used to split a string into an array of strings.
Method 4: Get it done with regular rules
The above are the 4 methods that I know. They are all recorded. Friends in need can refer to them. If you have other methods, please let me know. Thank you