Solved

Separating a String into 4 Separate Strings

Posted on 2006-10-27
6
202 Views
Last Modified: 2010-03-31
I have the following String...

String custInfo = "Timothy Woods; Toys'R'Us; 12345; 101 Victory Street, Columbus, Ohio 43230";

Can this be done in a quicker way than just declaring 4 Strings separately?

Thanks Everyone!
0
Comment
Question by:tristatefab
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Accepted Solution

by:
cpa199 earned 32 total points
ID: 17818130
0
 
LVL 8

Assisted Solution

by:colr__
colr__ earned 31 total points
ID: 17818230
String[] splitStrings = custInfo.split(";");
0
 
LVL 6

Assisted Solution

by:valipotor
valipotor earned 31 total points
ID: 17818405
>>> Can this be done in a quicker way than just declaring 4 Strings separately?

As for execution time, declaring them as 4 separate strings it the fastest of them all.
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 31 total points
ID: 17818844
String[] custInfoAr = { "Timothy Woods", "Toys'R'Us",  "12345", "101 Victory Street",  "Columbus", "Ohio",  "43230" };

CustomerInfo ci = new CustomerInfo(custInfoAr); // make your own class for tis
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question