I want to replace all occurrences of
white space characters (space, tab, newline) in JavaScript.
How to do so?
I
tried:
str.replace(/ /gi,
"X")
I want to replace all occurrences of
white space characters (space, tab, newline) in JavaScript.
How to do so?
I
tried:
str.replace(/ /gi,
"X")
You want
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions"
rel="noreferrer">\s
Matches a single white space
character, including space, tab,
form
feed, line feed.
Equivalent
to
[
\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]
in
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-white-space"
rel="noreferrer">Firefox and [ \f\n\r\t\v]
in
rel="noreferrer">IE.
str = str.replace(/\s/g,
"X");
I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...
No comments:
Post a Comment