标签: java
我想知道如何重新排列字符串中的内容。例如, 如果它是String s = "Stack,over,flow";如何用堆栈或堆栈改变流的位置?
String s = "Stack,over,flow";
答案 0 :(得分:2)
没有内置支持,我认为最明显的解决方案是:
String s = "Stack,over,flow"; String[] arr = s.split(","); // now you have all the parts in arr, you can reconstrut your new string here.