Reputation: 21
Is there any way to merge String
item in list with another string ?
for example:
I have this list
final list1 = ['Hello'];
i need when click on button add World
word to Hello
word
so the list will be
['Hello World']
Upvotes: 1
Views: 75
Reputation: 268544
Use
final list1 = ['Hello']; // given
String hello = list1[0]; // get first letter
String world = 'World'; // letter you want to add
list1[0] = hello + ' ' + world; // concatenate both string and update list
Upvotes: 1