toCapCase function

String toCapCase(
  1. String input
)

Returns input with first letter capitalized and the rest lowercase.

Implementation

String toCapCase(String input) =>
    '${input[0].toUpperCase()}${input.substring(1).toLowerCase()}';