A basic JavaScript technique, based on the specified characters in a string, get the string with the left or right character. Taking the email in this example as an example, it can get the user name of the email, and other than the user name discard the characters, this example should be more practical.