1 year ago

#76224

test-img

M. Babik

Insert char to List<string>

Is it possible to insert char to List?

List<string> arr = new List<string>()
{
   "mobilePhone",
   "CoffeeMachine"
};

I would like insert " " at index [0][6] and [1][6] but when I use this:

arr[0].Insert(6," ");

It returns a new string that is equivalent to this instance but I need to save it at the same list.

c#

list

insert

0 Answers

Your Answer

Accepted video resources