String Property codeUnits



Returns a list of the UTF-16 code units of a given string.

Syntax

String.codeUnits

Example

void main() { 
   String str = "Hello"; 
   print(str.codeUnits); 
} 

It will produce the following output −.

[72, 101, 108, 108, 111] 
dart_programming_string.htm
Advertisements