search a char in a string and write the next word to a new string

Hi,

I have a string which contains for example "bla bla something test1 = unknown".

I want to search the "=" and check if "test1" is infront of the =. If thats the case, i want to write "unknown" (which might be any word) to a new string.

I'm using Dev-C++ 4.9.9.2.

I would appreciate any input, thanks in advance! Emufarm
If it is just a single character, you can use .find() to find its position, then use .substr() to get a substring of the data.

http://www.cplusplus.com/reference/string/string/
(Under String Operations)
It works, thank you!
Topic archived. No new replies allowed.