代碼如下
//設備總數 List<String> strList = devices.stream().map(Device::getDevice_id).collect(Collectors.toList()); //將Object數組轉換為String數組 String[] strByte = strList.toArray(new String[0]); //將數組拼接成一個長的字符串 String devIds = String.join(",",strByte);
歡迎關注作者微信公眾號