Разделение строки []

ОБНОВЛЕНИЕ:

вывод должен быть:

chapter: Chapter 01
title: one
code: 111111

chapter: Chapter 02
title: two
code: 222222

chapter: Chapter 03
title: three
code: 333333

chapter: Chapter 04
title: four
code: 444444

chapter: Chapter 05
title: five
code: 555555

У меня есть этот код для разделения строки []. Я не уверен, в чем проблема. кто-нибудь может мне помочь?

String[] myArray = "Chapter 01<<<one<<<111111:::Chapter 02<<<two<<<222222:::Chapter 03<<<three<<<33333:::Chapter 04<<<four<<<4444:::Chapter 05<<<five<<<5555:::"

просто для простоты я сделал пустышку String []

for (int j = 0; j < myArray.length; j++)
{
String[] songs = myArray[j].split("\\<<<");

System.out.println("chapter: " + songs[0]);
System.out.println("title: " + songs[1]);
System.out.println("code: " + songs[2]);
} 

, поэтому я хочу видеть в результате:

chapter: Chapter 01
title: one
code: 111111
............so on and so forth........
0
задан issoa 28 February 2012 в 05:23
поделиться