1 works

Capitalize the first letter of a String


dashboard+ Project

Posted by @bassel #dart #flutter

String capitalize(String s) {
  if (s == null || s.isEmpty) {
    return s;
  }
  return s.length < 1 ? s.toUpperCase() : s[0].toUpperCase() + s.substring(1);
}
content_copyCopy to Clipboard

>> Browse more code snippets

more_vert