我想打印一个从字符集合转换而来的字符串。但我想从打印字符串中删除逗号(,)和方括号([])。
List<Character> word_to_show = new ArrayList<Character>();
for(char ch:jumbled_word.toCharArray()){
word_to_show.add(ch);
}
Collections.shuffle(word_to_show);
for (Object ch: word_to_show)
System.out.print((Character) ch );
System.out.println();
send_to_timer = word_to_show.toString();
我已经到了这个地步。它可以工作,但将字符串打印为,例如 [a, b, c]
最佳答案
关于java - 将 char 集合转换为不带逗号和方括号的字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29509589/