I have any number of variables string. I want to do something on them in method.
for example
string s1 = "s1";
string s2 = "s2";
List<string> list = new List<string>();
list.Add(s1);
list.Add(s2);
SomeMethod(list);
Console.Writeline(string.Format("{0} {1}, s1, s2));
// I want have here value after SomeMethod. Its possible without rewriting back from the list to variable???
void SomeMethod(List<string> list2)
{
// do something with list2 for example list2[0] = "s11";
}
I want do it with params, but cant connect params with ref, so mayby its possible in list or array...