-
-
Save gnjo/1067870b2a5aa0a027683bf4daa7c309 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