I am trying to parse a string and see if the value after ":" is integer. If it is not an integer, remove "Test: M" from the line.
Here is an example that I have.
string testString = "Test:34,Test:M";
As a result, I need testString = "Test:34"
string[] data = testString.Split(','); for (int i = 0; i < data.Length; i++) { string[] data1 = data[i].Split(':'); int num = 0; if(Int32.TryParse(data1[1], out num)) { } }
source share