My question is, if I have a list that looks something like the following,
var list = new List<string>();
list.Add("12345");
list.Add("Words");
list.Add("Are");
list.Add("Here");
list.Add("13264");
list.Add("More");
list.Add("Words");
list.Add("15654");
list.Add("Extra");
list.Add("Words");
And I want to be able to delete all the strings that start with numbers from the list and also concatenate the strings in between them so that it looks like the following,
Words Are Here
More Words
Extra Words
How does that logic look? Below is what I have been trying to do, but I can't first out how to delete the strings with number much less create a newline when i delete a string with numbers.
foreach (string s in list)
{
if (s.StartsWith("1"))
s.Remove(0, s.Length);
else
String.Concat(s);
}
foreach (string p in list)
Console.WriteLine(p);