View Single Post
  #2 (permalink)  
Old January 23rd, 2006, 01:09 PM
ciderpunx ciderpunx is offline
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

In perl:
my ($city,$cat,$subcat) = split /-/,$ID;

In Java, you could use a StringTokenizer:
import java.util.*;
/*do ID concatenation, etc...*/
StringTokenizer st = new StringTokenizer(ID,"-");
city = st.nextToken();
cat = st.nexttoken();
subcat = st.nextToken();

Tutorial here:
http://www.devdaily.com/java/edu/pj/...pj010006.shtml

HTH
Charlie

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
Reply With Quote