public class StrToArray {
public static void main(String[] args) {
String s = "01040104100410401040104014010401041040";
StringBuffer s1 = new StringBuffer(s);
int index;
for (index = 2; index < s1.length(); index += 3) {
s1.insert(index, ',');
}
String[] array = s1.toString().split(",");
for (String string : array) {
System.out.print(string+"--");
}
}
}
运行效果: