Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: string spli...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 9559 of 9775
Post > Topic >>

Re: string splitting

by Alexey Stepanyan <alexeystepanyan@[EMAIL PROTECTED] > Apr 29, 2008 at 05:40 PM

Sorry, my previous post should have included the following code
after the string is split into tokens

( srcaddress and src****t ( the same for destaddress and dest****t ) )

.....

   std::string source( "131.188.37.230.22" );
   std::string srcaddress = s.substr( 0, s.find_last_of( "." ) );
   std::string src****t = s.substr( s.find_last_of( "." ) + 1 ); ;

   std::cout << "srcaddress = " << srcaddress << std::endl;
   std::cout << "src****t = " << src****t << std::endl;

------------------

srcaddress = 131.188.37.230
src****t = 22

Thanks,
Alexey.

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 5 Posts in Topic:
string splitting
xyz <lavanyareddy.p@[E  2008-04-29 10:43:22 
Re: string splitting
"Hakusa@[EMAIL PROTE  2008-04-29 17:38:05 
Re: string splitting
Alexey Stepanyan <alex  2008-04-29 17:38:54 
Re: string splitting
Alexey Stepanyan <alex  2008-04-29 17:40:29 
Re: string splitting
"Devdatt Lad" &  2008-04-30 10:41:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Jul 8 23:43:36 CDT 2008.