Longueur de la propriété de chaîne

Renvoie la longueur de la chaîne, y compris les caractères d'espace, de tabulation et de nouvelle ligne.

Syntaxe

String.length

Exemple

void main() { 
   String str = "Hello All"; 
   print("The length of the string is: ${str.length}"); 
}

Il produira ce qui suit output -.

The length of the string is: 9