Convert String into List of Characters

To convert given string into a list of characters in Dart, call split() method on the string and pass empty string as argument to the method. The method returns a list with the characters of the string as elements.

The syntax of expression to get the list of characters from the string myString is


Dart Program

In the following program, we take a string 'apple' in variable myString, and convert the string into a list of characters.


void main() {
    var myString = 'apple';
    var output = myString.split('');


[a, p, p, l, e]


In this Dart Tutorial, we learned how to split the given string into a list of characters in Dart.