java中split的用法
//定义的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; }