reverse property

String get reverse

翻转字符

Implementation

String get reverse {
  if (this.isEmpty) return '';
  StringBuffer sb = StringBuffer();
  for (int i = length - 1; i >= 0; i--) {
    sb.writeCharCode(codeUnitAt(i));
  }
  return sb.toString();
}