79796189

Date: 2025-10-21 19:56:10
Score: 1.5
Natty:
Report link

You can write a simple validator, that compares a string to its upper case equivalent

bool isUppercase(String str) {
  return str == str.toUpperCase();
}

implementation

void main(){
 String str = "Hello World!";
 bool startsWithUppercase = isUppercase(str[0]);
 print("Starts with upper case: $startsWithUppercase");
}

The docs https://pub.dev/documentation/string_validator/latest/string_validator/isUppercase.html shows how to check if a string is uppercase in dart

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Akumbom