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