capitalizedLetters property

String get capitalizedLetters

句子每个单词首字母大写

Implementation

String get capitalizedLetters {
  try {
    String temp = '';
    split(' ').forEach((s) {
      temp += '${s[0].toUpperCase()}${s.substring(1)} ';
    });
    return temp;
  } catch (e) {
    return '${this[0].toUpperCase()}${substring(1)}';
  }
}