I'm having a bit of problems getting a piece of a string.
The string I have looks something like this.
50.184.xxx.xx:52240/7656119xxxxxxxxxx/John joined [windows/7656119xxxxxxxxxx]
Where x's can be different lengths, also John could be different name.
I have extracted the numbers from this string using find_first_of and find_last_of combinations by getting the "[" and "/" etc but I cannot figure out how to extract John. Any help would be greatly appreciated.
If I need every piece of information here I would make a class holding that connection information and then overload operator<<
If you just need John you could go to the second "/" and then read until the next space.
If that's not good enough (eg. if the user may have spaces in his name) you're fucked :)
Nah, jokes aside, if that's not good enough go to the last "[" (find_last_of) and then go back 8 steps, then search for the last "/" before "[" and go forth 1 step.
Everything between those two points is the Name of the person.