当前位置: 首页 > 文档资料 > Dart 中文教程 >

codeUnits

优质
小牛编辑
125浏览
2023-12-01

返回给定字符串的UTF-16代码单元列表。

语法 (Syntax)

String.codeUnits

例子 (Example)

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

它将产生以下output - 。

[72, 101, 108, 108, 111]