Am in need of some help with a string iterator.
Basically I want to set the iterator to a particular location of a string, such as that returned by the string::find() function.
Any help would be greately apreciated.
Later,
Am in need of some help with a string iterator.
Basically I want to set the iterator to a particular location of a string, such as that returned by the string::find() function.
Any help would be greately apreciated.
Later,
WebmasterMattD
WebmasterMattD.NET
string::find() returns an interator, just do an assignment with the return value.
>>string::find() returns an interator,
No,string::find returns string::size_type.
You can do this
Code:string::size_type st = str.find("..."); string::iterator strIter = str.begin(); strIter += st;
You're right, I was thinking of the generic find from <algorithm>.
Thanks for that.
incrementing the iterator by the number of possitions relative to the start worked.
Later,
WebmasterMattD
WebmasterMattD.NET