Home > Mobile >  How to remove first word from a sentence in flutter - dart
How to remove first word from a sentence in flutter - dart

Time:09-27

Looking for the same solution that was given in swift here - How to remove first word from a sentence in swift.

Anyone can help?

CodePudding user response:

void main() {
String words = "hello world everyone";
List<String> word_l = words.split(" ");
String word = word_l.sublist(1,word_l.length).join(" ");
print(word);
}

Use as above code to remove first word from words. This work for multiple words more than 2.

CodePudding user response:

You could just do this:

void main() {
  var data = 'CITY Singapore';
  data = data[0];
  print(data);
}
  • Related