orEmpty method
Returns the string or an empty string if null.
Example:
String? name = null;
print(name.orEmpty()); // ''
Implementation
String orEmpty() {
return this ?? "";
}
Returns the string or an empty string if null.
Example:
String? name = null;
print(name.orEmpty()); // ''
String orEmpty() {
return this ?? "";
}