var str = 'The quick brown fox @ ';
var str = str.split(/\s/);
var str = str.join('_');
The result of this operation is “The_quick_brown_fox_@_”, How can I only split if the space is followed by a character and this character is not a “@”?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use lookahead:
Yields
Joins into: “The_quick_brown_fox @ “