codeUnitAt()
返回给定索引处的16位UTF-16代码单元。
语法 (Syntax)
String.codeUnitAt(int index)
参数 (Parameter)
Index - 表示字符串中的字符索引。
返回值 (Return Type)
返回一个整数。
例子 (Example)
void main() {
var res = "Good Day";
print("Code Unit of index 0 (G): ${res.codeUnitAt(0)}");
}
它将产生以下output - 。
Code Unit of index 0 (G): 71