I have a large string that has a series of floating points in string. A typical string would have Item X $4.50 Description of item \r\n\r\n Item Z $4.75... There is really no rhyme or reason for the text. I have the lowest already and I need to find all the values in the string. So if it was 10.00 it would find every value that is 10.05 or less. I would assume that some sort of regex would involved to find the values and then I could put them in an array then sort them.
So it would be something like this to find the which of those values fit my criteria.
int [] array;
int arraysize;
int lowvalue;
int total;
for(int i = 0; i<arraysize; ++i)
{
if(array[i] == lowvalue*1.05) ++total;
}
My problem is getting those values in the array. I have read this but d+ does not really work with floating points.
You should use RegEx:
Something like that. Then you can just use:
If you need an array:
EDIT
I just created a small sample application for you Joe. I compiled it and it worked fine on my machine using the input line from your question. If you are having problems, post your InputString so I can try it out with that. Here is the code I wrote: