Created
August 28, 2010 04:48
-
-
Save KOBA789/554734 to your computer and use it in GitHub Desktop.
This file contains 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
// 全置換:全ての文字列 org を dest に置き換える | |
String.prototype.replaceAll = function (org, dest){ | |
return this.split(org).join(dest); | |
} | |
var str = "なんとかかんとか" | |
str = str.replaceAll("とか", "だか"); | |
console.log(str); | |
// > なんだかかんだか |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment