lastOrNone property

Option<String> get lastOrNone

Returns the last character as a Some, or None if the string is empty.

Implementation

Option<String> get lastOrNone =>
    isEmpty ? const None() : Some(this[length - 1]);