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 == null) return null;
  if (this!.isEmpty) return this;
  return '${this![0].toUpperCase()}${this!.substring(1).toLowerCase()}';
}