VOOZH about

URL: https://www.geeksforgeeks.org/dart/how-to-find-the-length-of-a-string-in-dart/

⇱ How to Find the Length of a String in Dart? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Find the Length of a String in Dart?

Last Updated : 7 Apr, 2025

To find the length of a string in the dart, we make use of the length property of a string class in Dart. This method returns the length of the string, which is an integer.

Syntax: string_name.length
Return Type: Integer

Image Representation:

👁 Length_of_string

Find the length of the string

Example:


Output:

15

Explanation: The length of the string, including spaces in the above example, counts up to 15.

Note: The length of the empty string is equal to 0.

Comment
Article Tags:
Article Tags:

Explore