代码如下

//设备总数
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);

 

相关文章:

  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2021-05-20
  • 2022-12-23
  • 2021-12-27
  • 2021-07-21
  • 2022-12-23
相关资源
相似解决方案