I want to make a new String
after splitting the existing String
and searching it through all the Lists
existing. The only elements which exist in the the Lists
should make the New String
. Below is the code in flutter. I am able to break the existing String into List of elements and now I want to search all splitted elements whether they exist in the predefined lists or not. Only those elements which exist in the predefined lists should be used to make the new String
Please guide me how can I do this.
List A = ["ra", "rb", "rc", "rd", "re"];
List B = ["rf", "ra", "rh", "ri", "rj"];
List C = ["k", "l", "m", "of", "o"];
List D = ["p", "q", "r", "s", "a"];
List E = ["a", "9", "5", "u", "z"];
String text = "h a s q ra rc";
List newText = text.toLowerCase()
.split(' ') // split the text into an array
.map((String text) => Text(text)) // put the text inside a widget
.toList();
question from:
https://stackoverflow.com/questions/65858108/how-to-filter-the-text-string-and-make-a-new-string-in-flutter 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…