reverse static method
字符串反转
Implementation
static String reverse(String str) {
if (str.isEmpty) return '';
// StringBuffer sb = StringBuffer();
// for (int i = str.length - 1; i >= 0; i--) {
// sb.writeCharCode(str.codeUnitAt(i));
// }
// return sb.toString();
return String.fromCharCodes(str.runes.toList().reversed);
}