我有一根绳子:
var test = "toto@test.com";我想将"@“字符后面的所有字符替换为空值。我想要得到这条线:
var test = "toto"发布于 2014-08-06 10:05:47
试试这个:
test= test.split('@')[0]发布于 2014-08-06 10:06:15
"toto@test.com".replace(/@.+$/, '')https://stackoverflow.com/questions/25157499
复制相似问题