1
執行此操作的最簡單方法是什麼?在javascript中添加2個字節之間的字符
我有這樣的字符串。
var string='0ABAFFACBDFE...';
我想將其轉換爲此。
var newString= '0A,BA,FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..FF,AC,BD,FE ..';
看到這個http://stackoverflow.com/questions/7033639/javascript-split-large-string-in-n-size-chunks和使用'join' – Dave