Reputation: 81
String id = "GJBR3I6R";
how to convert String id into integer or Ascii value ?
Upvotes: 4
Views: 5683
Reputation: 31
import 'dart:convert';
String id = "GJBR3I6R";
const asciiEncoder = AsciiEncoder();
print(AsciiEncoder().convert(id));
Output:
[71, 74, 66, 82, 51, 73, 54, 82]
for more information about how to convert string to its ASCII value refer to the below link https://kodeazy.com/flutter-string-to-ascii/
Upvotes: 3
Reputation: 507
You can do the following:
String id = "GJBR3I6R";
print(id.codeUnits);
Output:
[71, 74, 66, 82, 51, 73, 54, 82]
Upvotes: 7