/Dart 2

length property

int length

The length of the string.

Returns the number of UTF-16 code units in this string. The number of runes might be fewer, if the string contains characters outside the Basic Multilingual Plane (plane 0):

'Dart'.length;          // 4
'Dart'.runes.length;    // 4

var clef = '\u{1D11E}';
clef.length;            // 2
clef.runes.length;      // 1


int get length;

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.