Last active
December 21, 2015 03:55
-
-
Save think2011/a6be35c68227849cad0d to your computer and use it in GitHub Desktop.
替换换行
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 替换换行为XX | |
* @param str | |
* @param replaceStr | |
* @returns String | |
*/ | |
function replaceNewLine (str, replaceStr) { | |
return str.replace(/(\r\n|\r|\n)/g, replaceStr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment