Java: convert List to a String

前端 未结 22 2632
日久生厌
日久生厌 2020-11-22 01:03

JavaScript has Array.join()

js>[\"Bill\",\"Bob\",\"Steve\"].join(\" and \")
Bill and Bob and Steve

Does Java have anything

22条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 01:49

    Google's Guava API also has .join(), although (as should be obvious with the other replies), Apache Commons is pretty much the standard here.

提交回复
热议问题