String split() Method



Splits the string at matches of the specified delimiter and returns a list of substrings.

Syntax

split(Pattern pattern)

Parameters

  • pattern − represents the delimiter.

Return Type

Returns a list of String objects.

Example

void main() { 
   String str1 = "Today, is, Thursday"; 
   print("New String: ${str1.split(',')}"); 
} 

It will produce the following output −.

New String: [Today,  is,  Thursday]
dart_programming_string.htm
Advertisements