Hello
my question how can I split array of string to another string using for loop
for example if i have this array of string joe,DE2300,A sam,RM4901,B allay,SM9800,D << name, course, grade
I want to split the array to another array
so the output will be
//I want this list to be in array called gradeBook
Name: joe course:DE2300 grade:A
Name: sam course:RM4901 grade:B
Name: allay course:SM9800 grade:D
sk8ergirl
0
Newbie Poster
Recommended Answers
Jump to Posthave this array of string joe,DE2300,A sam,RM4901,B allay,SM9800,
That doesn't look like an array. It looks like a String.
To split that String up into separate Strings in an array look at the String class's split() methodwant to split the array to another array
What …
Jump to PostThe String class's split() method creates the array by splitting then String.
Do a search here on the forum for sample code,
or ask google: java string split
Jump to PosttxtOutput.append(temp.format); //I got red line under format why
The compiler can not find the field for the variable: temp
temp is a array of Strings. arrays have few fields. length is the ony one I know of.What is that code supposed to do?
All 12 Replies
NormR1
563
Posting Sage
Team Colleague
sk8ergirl
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
sk8ergirl
0
Newbie Poster
sk8ergirl
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
sk8ergirl
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
jalpesh_007
-3
Newbie Poster
sk8ergirl
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
sk8ergirl
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.