This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi all, I have an address that is coming in the form of 2000-2345 S Campbell Avenue I want to get three substrings : 2000 2345 and S Campbell Avenue Then I want to create 2000 S Campbell Avenue and 2345 S Campbell Avenue How can I do it ? Any sample code,.. Please Also the address can have a white character(space) between 2000 and - and 2345 ie, it can be 2000 - 2345 S Campbell Avenue Any help. Thanks, Maya
If you use the StringTokenizer class and set the delimiters to a space and a hyphen, then check the token for numeric or alpha, you can concatenat the alpha tokens back together putting the spaces back in. The only problem might be if there was a hyphen in the alpha name of the street.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Sep 29, 2000
I see you got a working solution in Beginner. Please do not cross post.