请我需要这种方法的帮助:
String d = ret.getData(); //I get the string using this
int ui;
ui = d.indexOf("=", d.indexOf("=")+1);
do{
int f=d.indexOf("=", ui+1 );
System.out.println(d.substring(ui+1, f-1));//Here I'm showing the results of my code
ui = ui + d.indexOf("=", ui);}
while ((d.indexOf("=") + ui)!= 0);
我拥有的字符串是这个:
!re
=.id=*1
=name=ether1
=mtu=1500
=l2mtu=1600
=mac-address=D4:CA:6D:37:44:26
=arp=enabled
=auto-negotiation=true
=full-duplex=true
=speed=100Mbps
=running=true
=slave=false
=disabled=false
我的代码的结果是:
*1
ether1
l2mt
24:22
nin
我想要得到的是:
*1
ether1
1500
1600
D4:CA:6D:37:44:26
enabled
true
true
100Mbps
true
false
false
我需要得到“=”之后的所有内容
请帮忙!谢谢