我有一个这样的字符串 -
"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 .....