SubString Help

Im currently working on something and fell on a stump and cant seem to get out of it.

What im trying to do is Find text and after the text get the next word lenght like this.

It gets the text ":!test" from the string(irc text)
But it could be like "!test Rocket" or anything of course

Another Thing is I want to send the found items into one String not multiable times dont tell me how to do this one just want a hint on how to go about doing it
1
2
3
4
5
6
7
8
9
10
11
12
13
string Text;//Irc Text 								
string Found;
if (!(Text.find(":!test ") == std::string::npos)){
int A = Text.find(":!test ") + 7;
Found = Text.substr (A,NotSureWhatGoesHere);
for(int i = 0; i < Lines; i++){//Lines is how many current lines are in the file im reading into the TextArray
	std::string Search = TextArray[i];
	int B = Search.find(Found .c_str());
	   if(B >= 0) {
              SendToIrc(TextArray[i])//Needs Fixing
	}
    }
}


strtok is a nice function.

Say I wrote
strtok("!test what is up", " "); //First time would return "!test"
strtok(NULL, " "); //Second time "what"

And so on.
The second parameter is the number of characters to read.
http://cplusplus.com/reference/string/string/substr/
Yes but i need to read from the pos of ":!test " to the end of the line.
Turbined tested that method and still does nothing :(
and at Zhuge is that i dont know how many characters to read since the text is different each time

IRC Test looks like this
 
:MyNick!Hey@Host.Name.Is.Here PRIVMSG #channel :!test Rocket 


This is what im trying get. The last "X", Letters.
Topic archived. No new replies allowed.