Split & join String in dart

Jeet BhaluJeet Bhalu
1 min read

In Dart, you can split a string into a list of substrings using the split() method, and you can join a list of strings into a single string using the join() method.

Example:

void main() {
  List<String> parts = ["Hello", "World!"];

  String str = "Hello, Jeet";

  print(str.split(','));
  print(parts.join(',')); // Output: Hello, World!
}
0
Subscribe to my newsletter

Read articles from Jeet Bhalu directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Jeet Bhalu
Jeet Bhalu

i am Jeet Bhalu i am flutter App developer