Hi again.
I'm wondering if there's a function that finds the let's say forth 'c' character from a string. So if I have a string str = "abcdefcc89conecs";, and use the function like cout<<str.find_xth_of(4,'c');, it should print 10. Is there such thing ? Or do I have to use the classic find function more times ?
Thanks guys. Meanwhile, I also got an idea. cout<<str.find('\t',str.find('\t',str.find('\t',str.find('\t')+1)+1)+1); It doesn't look very good but it works. I need the 4th tab character in my program. So the parameters are known. Thanks again :)
I have again a problem but don't want to create another topic for it. I'm tired so most likely I'm missing something obvious. Could you guys please take a look ?
Smac...I guess I have to go to sleep. Sorry for the stupid question. I knew it was something dumb, but not that dumb.
cire, thanks for the nice function. In my program, I only have to search the xth 'x' from a string once, and that's the fourth tab character from a string. So I'll use the little algorithm I posted above. However, if I have to do this in another program, where I don't know the parameters at compile time, I'll check the functions you guys have posted here.
Thanks again to everyone !