Created
May 30, 2013 09:40
-
-
Save kenji0x02/5676813 to your computer and use it in GitHub Desktop.
javascriptで文字列をN文字ずつ分割す。正規表現つかって。
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
// ex: separate 2 letters, and add "¥¥x" | |
var segments = signal.match(/.{2}/g); | |
var code = "" | |
for (var i = 0; i < segments.length; i++) { | |
code += "¥¥x" + segments[i]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment