- public class Test {
- public static void main(String[] args) {
- String message = "Hello China!";
- StringBuilder str = new StringBuilder();
- for (int i = message.length() - 1; i >= 0 ; i--) {
- str.append(message.charAt(i));
- }
- System.out.println(str.toString());
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/1310201513799.html
来源: http://www.codesnippet.cn/detail/1310201513799.html