java截取字符串

[复制链接]
查看11 | 回复3 | 2012-2-23 14:36:26 | 显示全部楼层 |阅读模式
String str = "aa,bb,cc";String res = str.substring(0,6);System.out.println(res);String中的substring(int begin, int end)可以截取指定位置的子串。可以截取begin开始,到end-1结束的子串。...
回复

使用道具 举报

千问 | 2012-2-23 14:36:26 | 显示全部楼层
String中的substring(int begin, int end)可以截取指定位置的子串。可以截取begin开始,到end-1结束的子串。...
回复

使用道具 举报

千问 | 2012-2-23 14:36:26 | 显示全部楼层
Strings="aa,bb,cc";string [] str=s.split(",");string [] str1={"",""};for(int i=0; i<str.length-1;i++){str1=str;}...
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行