ITeye博客

java中split的用法

jws132 · 2012-07-13 12:06 · JAVA · 操作系统 · split · java中split的用发 · Markdown

//定义的type传过来的参数 public List ProfileRoleId(String type) { List ProfileRole = new ArrayList(); ///传过来的参数列如1,2,3,4,5, String[] profiles = type.split(","); if (profiles.length > 0) { for (int i = 0; i < profiles.length; i++) { System.out.println("profileId: " + profiles[i]); Users users = new Users(); //循环把type的参数查询出来 users = this.usersMapper.Users_Type(profiles[i]); if (null != users) { ProfileRole.add(profile); } } } return ProfileRole; }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。