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.
我有一个字符串"RSEBAK",我想将该字符串排序为"ABEKRS"
"RSEBAK"
"ABEKRS"
在安卓中可以吗?
如果是,请指导我完成。
您的规范有点模糊,但我认为您的意思是按字符串对章程进行排序?如果是这样……</p>
String s1 = "RSEBAK"; char[] arrC = s1.toCharArray(); Arrays.sort(arrC); String strSorted = new String(arrC);
strSorted 应该有“ABEKRS”