i was sure this should be easy but here i am. i have a text file with information of the tones required to play the mario theme. i was needing to read line by line and break out the numbers and put them in a array. the problem is i dont know how many digits the numbers will be and as far as i know only a char has a test for if it is a digit. i tried selecting out one char at a time and testing but that didnt work. any ideas?
:beep frequency=660 length=80ms;
:delay 200ms;
:beep frequency=760 length=50ms;
:delay 150ms;
:beep frequency=860 length=100ms;
:delay 300ms;
.....
while((s = sr.ReadLine()) != null)
{
if ((i = s.IndexOf("beep frequency=")) != -1)
{
for (int j = j + 15; ((char)s.Substring(j,1)).IsDigit ; j++)
{
//if it is a digit do some crazy stuff here
}
}
}