Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你好,我有这个字符串,它是一个数据表,我想测试字符串是否包含超过 _,然后我们正在切割链,在表行中的每个子字符串中,我使用 talend,我的输入是一个 excel,我真的卡住了谁能帮助我,请举例:JEN3030_1_2_3
试String.split()...
String.split()
String input = "JEN3030_1_2_3"; //or whatever List<String> output = new ArrayList<String>(); String[] parts = input.split("_"); for(int i = 1; i < parts.length; i++) { output.add(parts[0] + "_" + parts[i]); }