1String string = "004-034556";
2String[] parts = string.split("-");
3String part1 = parts[0]; // 004
4String part2 = parts[1]; // 034556
5
1String yourString = "Hello/Test/World";
2String[] strings = yourString.split("/" /*<- Regex */);
3
4Output:
5strings = [Hello, Test, World]
1String[] strings = "Thequickbrownfoxjumps".split("(?<=\\G.{4})"); // split all 4 chars
2String[] strings = "Thequickbrownfoxjumps".split("(?<=\\G.{100})"); // this would be all 100 chars
3// -> ['Theq', 'uick', 'brow', 'nfox', 'jump', 's']