Skip to content

Instantly share code, notes, and snippets.

@think2011
Last active December 21, 2015 03:55
Show Gist options
  • Save think2011/a6be35c68227849cad0d to your computer and use it in GitHub Desktop.
Save think2011/a6be35c68227849cad0d to your computer and use it in GitHub Desktop.
替换换行
/**
* 替换换行为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