capitalize property

String capitalize

Capitalizes the String in normal form.

Example

String foo = 'hAckErrR';
String cFoo = foo.capitalize; // returns 'Hackerrr'.

Implementation

String get capitalize {
  if (this.isBlank) {
    return this;
  }
  return '${this[0].toUpperCase()}${this.substring(1).toLowerCase()}';
}