私はこのような文字列を持っています -
"fruit=apple man=human abc=123"
値を次のように出力したい -
fruit=
apple
man=
human
abc=
123
つまり、区切り値も表示したいのです。現在、私はしようとしています-
String status2="fruit=apple man=human abc=123";
Scanner scn = new Scanner(status2).useDelimiter("[a-z]*=+");
while(scn.hasNext())
{
System.out.println(scn.next());
System.out.println(scn.delimiter());
}
しかし、区切り値が表示されません
apple
[a-z]*=+
human
[a-z]*=+
123
[a-z]*=+
更新された文字列 -
"cobdate=01/28/2013 fundsnotextracted= elapsedtime=00:06:02 user=dataprod starttime=Wed, 30 Jan 2013 11:50:30 periods=DAILY, MTD, YTD knowledgedate=01/30/2013:11:50:10 progress=67 statusstep=Generating Reports ....."
期待される出力 -
cobdate=01/28/2013
fundsnotextracted=
elapsedtime=00:06:02
user=dataprod
starttime=Wed, 30 Jan 2013 11:50:30
periods=DAILY, MTD, YTD
knowledgedate=01/30/2013:11:50:10
progress=67
statusstep=Generating Reports .....