OK, I admit string manipulation has never been a strong point of mine when it comes to C++, and although i've had quite a success at various cases simply by using Boost, I'm still having some issues.
So, here's what I need (the example is precise)...
The input is :
position fen <arg_a1> <arg_a2> ... <arg_aN> moves <arg_b1> <arg_b2> ... <arg_bN>
(well, for those whose who are familiar with the topic, it's a UCI protocol's command)
All I want to do is :
- get
<arg_a1> <arg_a2> ... <arg_aN>
(with the spaces included) into one string (that is the string betweenposition
andmoves
- also get
<arg_b1> <arg_b2> ... <arg_bN>
into another string (that is the string frommoves
till the end).
I've played a lot with Boost::split
but obviously this is working much like strtok
(accepting character and not string delimiters).
How should I go about that? What's the easiest way to solve this particular issue, without my reinventing the wheel (which I tend to do... quite often... lol)?
HINT : Obviously I can do it. But all I could think of right now is quite ugly. What I'm looking for is a C++-friendly way...