Time to post in the Beginners section. So embarassing.
Now, now.
Until now i've been doing file handling with C streams and separating whitespace with my bare hands.
I'd like a C++11 equivalent that doesn't make me put my hands in a place to write
'\r'
,
'\n'
, or
"\r\n"
anymore.
The exact question is:
Given the following input...
key = value
k e y = value
k ey= v alue
ke y =va lue
|
How in the world do I skip the (optional) whitespaces, and retrieve both key and value?
All the four keys listed above are DIFFERENT from each other. Spaces in the key must be kept.
Both key and value may contain whitespaces. Only value may contain a "=" character.
May this seem like a school-related question, it is NOT.
I'm not at school.
After switching to C++11, I was just looking to make a completely portable program, which happens to deal with some configuration thingies.
I'm not looking for a straight answer.
Just give me tips like:
How to skip all whitespaces - How to read all whitespaces - How to skip a specific character