JAVA,截取字符串,存放在数组中
List<String> selectIdsArray = new ArrayList<String>();
//选中行的记录数 p_selectIds字符串以“,”为分隔符
int count = StringUtils.countMatches(p_selectIds, ",");
for (int i=0;i<count;i++)
{
String p_selectIds_singal = p_selectIds.substring(0, p_selectIds.indexOf(","));
selectIdsArray.add(p_selectIds_singal);
p_selectIds = p_selectIds.substring(p_selectIds.indexOf(",")+1);
}
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: 数组名和数组名取地址的区别
- 下一篇: java实现数组的增删改查