1、使用 org.apache.commons.lang.StringUtils 中的 join 函数。

StringUtils.join(array, ",");

2、使用 Google Guava 中的 com.google.common.base.Joiner 类。

Joiner.on(',').join(array); 

 

相关文章:

  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-16
  • 2022-12-23
  • 2021-07-29
  • 2022-12-23
  • 2021-12-11
  • 2021-11-10
  • 2022-12-23
相关资源
相似解决方案