返回给定索引的16位UTF-16 code unit。
String.codeUnitAt(int index)
index - 表示字符串中字符的索引。
来源:LearnFk无涯教程网
返回一个整数。
void main() { var res="Good Day"; print("Code Unit of index 0 (G): ${res.codeUnitAt(0)}"); }
它将产生以下输出-。
Code Unit of index 0 (G): 71
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)