将字符串拆分为三个没有分隔符的部分(Java)

Mik*_*ike 0 java

我有一个 String

String test = "7462356098660AE";
Run Code Online (Sandbox Code Playgroud)

我想把它分成:

test1 = "746";
test2 = "2356";
test3 = "0986";
test4 = "60AE";
Run Code Online (Sandbox Code Playgroud)

String的长度test将始终相同.

我怎么能这样做?

PS:我已经检查了其他问题,但找不到合适的答案.

Jag*_*ger 5

String test = "7462356098660AE";
String test1 = test.substring(0,3);
String test2 = test.substring(3,7);
String test3 = test.substring(7,11);
String test4 = test.substring(11,15);
Run Code Online (Sandbox Code Playgroud)