prepend method
- String? prefix
Prepends a prefix
to the String
.
Example
String foo = 'world';
String newFoo = foo1.prepend('hello '); // returns 'hello world'
Implementation
String prepend(String? prefix) {
if (isBlank) {
return prefix ?? "";
}
return (prefix ?? "") + this;
}