如何在javascript中替换\ n到<br/>

时间:2017-05-01 10:53:01

标签: javascript

 function replaceAll(find, replace, str) {
   //find=\n replace=<br/>
   //str=tyyrtu\nuiop\nuioui
            try {
                while (str.indexOf(find) > -1) {
                    str = str.replace(find, replace);
                }
                return str;
            }
            catch (e) { }
        }

如何在javascript中将字符串中的\ n替换为
?请帮我解决这个问题

1 个答案:

答案 0 :(得分:0)

&#13;
&#13;
https://www.facebook.com/v2.8/dialog/oauth?client_id=<MYCLIENTID>&redirect_uri=https://www.example.com/login.aspx?loggedin=true&scope=email,picture,age_range,cover
&#13;
&#13;
&#13;