toCapitalize method

String? toCapitalize()

Capitalize first letter

Implementation

String? toCapitalize() {
  if (this == null) {
    return null;
  }

  if (this!.trim().length > 0) {
    return this!.replaceFirst(this![0], this![0].toUpperCase());
  } else {
    return this;
  }
}