Dart Runes string
Syntax & Examples

Runes.string property

The `string` property in Dart returns a string representation of the sequence of Unicode code points.


Syntax of Runes.string

The syntax of Runes.string property is:

 String string 

This string property of Runes

Return Type

Runes.string returns value of type String.



✐ Examples

1 Convert sequence to string

In this example,

  1. We create a sequence of Unicode code points runes from the string 'Hello'.
  2. We use the string property to get the string representation.
  3. We then print the result to standard output.

Dart Program

void main() {
  Runes runes = Runes('Hello');
  String str = runes.string;
  print('String representation: $str');
}

Output

String representation: Hello

2 Convert sequence of emojis to string

In this example,

  1. We create a sequence of Unicode code points emojis from the string '👋🏽🚀🌟'.
  2. We use the string property to get the string representation.
  3. We then print the result to standard output.

Dart Program

void main() {
  Runes emojis = Runes('👋🏽🚀🌟');
  String emojiString = emojis.string;
  print('Emoji string: $emojiString');
}

Output

Emoji string: 👋🏽🚀🌟

Summary

In this Dart tutorial, we learned about string property of Runes: the syntax and few working examples with output and detailed explanation for each example.