toBase64 method

String toBase64()

Encodes the string to Base64.

Example:

"Hello".toBase64(); // Returns "SGVsbG8="

Implementation

String toBase64() {
  if (isEmpty) return this;
  return base64Encode(utf8.encode(this));
}