java分割字符串难题

[复制链接]
查看11 | 回复3 | 2012-11-28 13:56:45 | 显示全部楼层 |阅读模式
//我的理解是 该字符串超过了30 则前30长度里找最后一个逗号,并以此截取开来//如果不是这个意思 可以回复我一下 public static void main(String[] args) {String a="1234556, 4587864645, 4876454545, 486485454,1545";Test.test1(a); }public static void test1(String str){if(str != null && str.length()>30){ int strLength = str.length(); System.out.println(...
回复

使用道具 举报

千问 | 2012-11-28 13:56:45 | 显示全部楼层
String a="1234556, 4587864645, 4876454545, 486485454,1545";intlen = 25;if (a.length()>len) {for (int i = 1; iarr = ne...
回复

使用道具 举报

千问 | 2012-11-28 13:56:45 | 显示全部楼层
public static void main(String[] args) {String a="1234556, 4587864645, 4876454545, 486485454,1545,1234556, 4587864645, 4876454545, 486485454,1545";List arr = new Ar...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行