Answers for "If you need to support IE 8, you can use replace() with a regular expression instead:"

0

If you need to support IE 8, you can use replace() with a regular expression instead:

var str = "       Hello World!        ";

  alert(str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''));
Posted by: Guest on April-23-2021

Code answers related to "If you need to support IE 8, you can use replace() with a regular expression instead:"

Browse Popular Code Answers by Language