标签:ringbuf code lan 代码 class uil 字符串 app str
使用 StringBuilder 或者 stringBuffer 的 reverse() 方法。
示例代码:
// StringBuffer reverse
StringBuffer stringBuffer = new StringBuffer();
stringBuffer. append("abcdefg");
System. out. println(stringBuffer. reverse()); // gfedcba
// StringBuilder reverse
StringBuilder stringBuilder = new StringBuilder();
stringBuilder. append("abcdefg");
System. out. println(stringBuilder. reverse()); // gfedcba
标签:ringbuf code lan 代码 class uil 字符串 app str
原文地址:https://www.cnblogs.com/zhaobobo001/p/14931388.html