2
I have a variable that can store compound words, as in the example below. I would like help with the method replace()
in order to replace all after the 1st (first) white space, does not matter its content and length. So the variable value phr
would be "Stirred up", and would be "Stirred", eliminating everything from the 1st (first) white space, i.e., "up" would be deleted in the given example. It is important that the elimination is performed through the method replace()
, for the substitution criterion shall be the 1st (first) blank. Thanks for your attention.
var phr = 'stirred up';
Thank you very much André. Exactly what I wanted. Your reply was very helpful.
– eden
@If this answer served you, accept it to mark the problem as solved.
– Victor Stafusa