hi,
I am trying to replace an integer in string or list...what i have done is to use foreach loop..but it wouldnt replace it. The whole idea is that i have few lines of string in list and want to find a line and replace the int with another int,,,
here is the code :
foreach (var linesInList in list)
{
foreach (var number in Number)
{
if (linesInList.Contains(number.Value))
{
myNumber = Int32.Parse(linesInList.Trim().Substring(0, linesInList.Trim().IndexOf(' ')));
linesInList.Replace(myNumber.ToString(), number.Key.ToString());
}
}
}
help would be appreciated.
Thanks