I have a string: "ABD1254AGSHF56984,5845fhfhjekf!54685" and I want to loop through each character in this string and find any non numeric character and remove the characters until the next numeric character. i.e. remove all the non numeric characters from my string but these should be an indiciator that the numbers are seperate.
Output as an integer array:
1254
56984
5845
54685
These should be put into an array and converted as integers.
My attempt below but this just puts all the numbers as one rather than splitting them up based on the non numeric characters:
var input = "ABD1254AGSHF56984,5845fhfhjekf!54685";
var numeric = new String(input.Where(char.IsDigit).ToArray());
//This is the output of my attempt: 125456984584554685