如何用肥皂android系统分裂DATAS [英] How to split the datas in android while using soap

查看:215
本文介绍了如何用肥皂android系统分裂DATAS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个疑问,在使用肥皂,如何分割字符串,是否有可能。

  //这个原始数据下午,99127.79;
夜间67236.27;
晨61876.65;
晚上,20271.42;
家政服务,5444.05;我需要;
下午99127.79
夜67236
上午61876.65;
晚报20271.42;
家政5444.05;

我分裂使用分号,然后我不知道如何使用子字符串,开始和结束索引使用我不知道如何给values​​..Actually我想之前拆分 - 后 -


解决方案

 字符串total_string =下午,99127.79;夜间67236.27;晨61876.65;晚上,20271.42;家政服务,5444.05; 的String [] = spilted_string total_string.split();
的for(int i = 0; I< spilted_string.length;我++){
   的System.out.println(spilted_string [I] .split( - )[0]);
   的System.out.println(spilted_string [I] .split( - )[1]);
}

DEMO

I had a doubt while using soap ,how to split a string,Is there any possibility.

//this the original data

Afternoon-99127.79;
Night-67236.27;
Morning-61876.65;
Evening-20271.42;
Housekeeping-5444.05;

I need;
Afternoon        99127.79
Night            67236
Morning          61876.65;
Evening          20271.42;
Housekeeping     5444.05;

I split using semicolon and then i don't know how to use the sub strings,Use of start and end index i don't know how to give the values..Actually i want to split before "-" and after "-".

解决方案

String total_string = "Afternoon-99127.79;Night-67236.27;Morning-61876.65;Evening-20271.42;Housekeeping-5444.05;";

String[] spilted_string = total_string.split(";");
for (int i=0;i<spilted_string.length;i++){
   System.out.println(spilted_string[i].split("-")[0]);
   System.out.println(spilted_string[i].split("-")[1]);
}

DEMO

这篇关于如何用肥皂android系统分裂DATAS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆