1 point

Capitalize the first letter of a String


dashboard

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_copy




LISTS WITH THIS SNIPPET

>> Browse more code snippets

more_vert