lastChar method
Returns the last character of the string, or null if empty.
Implementation
String? lastChar() {
if (this.isEmpty) {
return null;
}
return this[this.length - 1];
}
Returns the last character of the string, or null if empty.
String? lastChar() {
if (this.isEmpty) {
return null;
}
return this[this.length - 1];
}