Dart-programming-string-property-codeunits

提供:Dev Guides
移動先:案内検索

文字列プロパティcodeUnits

指定された文字列のUTF-16コード単位のリストを返します。

構文

String.codeUnits

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

次の output -が生成されます。

[72, 101, 108, 108, 111]