toFirstUppercase function

  1. @useResult
String toFirstUppercase(
  1. String str
)

文字列の最初の文字を大文字にしたものを返す

Implementation

@useResult
String toFirstUppercase(String str) {
  if (str.isEmpty) {
    return '';
  }
  return str[0].toUpperCase() + str.substring(1);
}