String codeUnitAt Method

  • Post author:
  • Post category:Dart
  • Post comments:2 Comments
Dart Programming codeUnitAt Method

In this guide, we will discuss the String codeUnitAt Method in Dart Programming Language. Returns the 16-bit UTF-16 code unit at the given index.

Syntax

String.codeUnitAt(int index)

Parameter

  • Index − represents a character’s index in the string.

Return Type

Returns an integer.

Example

void main() { 
   var res = "Good Day"; 
   print("Code Unit of index 0 (G): ${res.codeUnitAt(0)}");  
}  

It will produce the following output −.

Code Unit of index 0 (G): 71  

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply