reverse method

String reverse()

Reverses this string

Example:

print('hello'.reverse()); // "olleh"

Implementation

String reverse() {
  if (isEmpty) return this;
  return split('').reversed.join('');
}