Use the appropriately named method String#split() . String string = "004-034556"; String[] parts = string.split("-"); String part1 = parts[0]; // 004 String ...
確定! 回上一頁