I was trying to find occurances of duplicate entries in a string
something like this
"1 + (2++34)-4*6/6*89"
So at first I tried this
String* str = S"1 + (2++34)-4*6/6*89";
int start;
int at;
int end;
int count;
end = str->Length;
start = 0;
Console::WriteL ine();
Console::Write( S"The string '++' occurs at position(s): ");
count = 0;
at = 0;
while((start <= end) && (at > -1)) {
count = end - start;
at = str->IndexOf(S"++ ", start, count);
if (at == -1) break;
Console::Write( S"{0} ", __box( at));
start = at+1;
}
Console::WriteL ine();
ok I can find ++ but what I wanted was instead of looking for
++ then -- then // thru some sort of loop
I was thinking
find_first_of( "++" "--" "**" "//" )
I know this doesn't work but can it be done simply?
thanks for any pointers (whoops wrong word) help :)
Jerry