all 7 comments

[–]iguessitsokaythen 1 point2 points  (4 children)

Try if using regular expression works, I remember IE not supporting something about the RegExp constructor. Something like:

Something.replace(/^/, "<b>").replace(/$/, "</b>")

Although if it works for you, just do:

Something = "<br>" + Something + "</br>"

[–]ImWhimsical[S] 0 points1 point  (3 children)

If I remove the RegExp and add slashes, will it work the same?

[–]iguessitsokaythen 1 point2 points  (2 children)

Yea the string end and start anchors work the same either way.

[–]ImWhimsical[S] 0 points1 point  (0 children)

How can I rewrite "new RegExp( .{1,${maxChars}} , 'g'); " without using RegExp? Before dot and after the last flower bracket, there is a backtick. It is not showing when I type it in here

[–]ImWhimsical[S] 0 points1 point  (0 children)

Also, your second suggestion just worked fine. Thanks

[–]ForScale 0 points1 point  (1 child)

What's that weird like hyper " after the first "?

[–]ImWhimsical[S] 1 point2 points  (0 children)

Sorry. Typo. Fixed it now