C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 5th, 2003, 04:07 PM
kenshiro kenshiro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Rochester, NY
Posts: 21 kenshiro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to kenshiro
Anybody know how to tokenize a string and...

and store it in an ArrayList?

Reply With Quote
  #2  
Old August 5th, 2003, 05:04 PM
johnrbradley johnrbradley is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 johnrbradley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You either
A) use a foreach with stringname.Split('char')
or
B) store in an array like array[] = stringname.Split('char') then pass off each element to the arraylist, maybe in a for(x<array.Count) ArrayList[x] = array[x];

I think the syntax for foreach is:
ArrayList a = new ArrayList();
String strtok = "String to tokenize";
foreach (String test = strtoke.Split(' '))
a.Add(test);

Or something to that extent, that should get you in the right direction.

Regards,
John

Reply With Quote
  #3  
Old August 6th, 2003, 04:16 PM
kenshiro kenshiro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Rochester, NY
Posts: 21 kenshiro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to kenshiro
Yeah that's it, thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Anybody know how to tokenize a string and...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT