String split() Method

  • Post author:
  • Post category:Dart
  • Post comments:2 Comments
String split() Method

In this guide, we will discuss the String split() Method in Dart Programming Language. 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]

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply