June 2017
Intermediate to advanced
873 pages
18h 9m
English
Dart Strings are immutable sequences of UTF-16 code units. UTF-16 combines surrogate pairs, and if you decode these, you get Unicode code points. Unicode terminology is terse, but Dart does a good job of exposing the different parts.
We will see the different methods to perform action on strings with special characters in unicode.dart:
String country = "Egypt";
String city = "Zürich";
String japanese = "日本語"; // nihongo meaning 'Japanese'
void main() {
print('Unicode escapes: \uFE18'); // the ⎕ symbol
print(country[0]); // E
print(country.codeUnitAt(0)); // 69
print(country.codeUnits); // [69, 103, 121, 112, 116]
print(country.runes.toList()); // [69, 103, 121, 112, 116]
print(new String.fromCharCode(69)); ...Read now
Unlock full access