I need to extract the numbers from the string in the code I shall attach, but the trick will be that there may be one, or up to about 5 possible items returned. I only want to extract the 6 digit numbers contained in the string.
Here is a string that contains an example. Each value is comma separated so it should be easy, I just don't have a clue how to go about doing it. The example has two numbers to extract.
COPS cmd may take 1 min for resp.
+COPS: (2,"My Network","","310410"),(0,"
My Network","","310260") //Need to extract these numbers from a string like this one.
private void timer2_Tick(object sender, EventArgs e)
_sp.ReadTimeout = 120000;
List<string> response = new List<string>();
response = SendCommand("at+cops=?", 4);
foreach (string line in response)
if (line.Contains("+COPS: ")) //here is where I identify the line with the information
//Ineed code here to extract numbers to an array