Hi,
Assume that you have the data in a string followed by some special character
and you want to read all the data enclosed within the special character than
.split() is used.
Example:
String data = 1#2#3;
Now to read all the data between the special character we will call:
String splitData[] = data.split("#");
After executing this statement splitData will have 3 element namely
splitData[0] = 1, splitData[1] = 2, splitData[2] = 3.
Thanks,
Hitesh Agarwal
http://www.hiteshagrawal.com
On Thu, Jun 18, 2009 at 11:15 AM, AfroJavaLover <[email protected]
> wrote:
>
> Does anyone have basic code where java .split(" "), is used. English
> is my second language and when I fail to get the concept of split I
> would rather look at the code syntax and method.
>
> http://www.javapassion.com/handsonlabs/javaarray/index.html#Homework
>
> I am stuck on the homework.
>
> Thank you for the code. I have done much googling before posting this,
> I have failed to understand the explanations, I would rather have
> sample code.
>
> Thank you.
>
> >
>
--
Hitesh Agarwal
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---