firstOrNone property

Option<String> get firstOrNone

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

Implementation

Option<String> get firstOrNone => isEmpty ? const None() : Some(this[0]);