I am trying to replace text with spaces so that no spaces remain.
Here is the sample text:
Content: “blah blah blah.”
The following script produces the following output
const findRegex = /\sContent:\s/g;
const replaceWith = "";
draft.content = draft.content.replace(findRegex, replaceWith);
draft.update();
Output:
“blah blah blah.”
Is there a way to produce output that does not start with a space? I thought the two ‘\s’ flags in the regex would do that.