【发布时间】:2016-06-27 03:58:49
【问题描述】:
即。我的字符串是“pqrstuw”。我怎样才能得到“t”的位置 4. 我想编辑每个字符并改变它的位置。用Java可以吗?
【问题讨论】:
-
是的。给五分钟,我给你示范。
-
How can I get " t" with its postion 4- 查看 String API 以了解您可以使用的方法。I want to edit each character and change its postion.- 查看 StringBuilder 类。 -
I want to edit each character and change its postion. Is it possible in Java?...如果你提供一些例子会更好 -
我认为您可以转换 String => 字符数组(通过使用 String 的 toCharArray() 方法),根据需要进行编辑并将字符数组转换回 String(通过使用 String' 构造函数)。跨度>
标签: java string position character