Java - Append quotes to strings in an array and join strings in an array

前端 未结 7 730
后悔当初
后悔当初 2020-12-13 00:04

I would like to append double quotes to strings in an array and then later join them as a single string (retaining the quotes). Is there any String library which does this?

7条回答
  •  天涯浪人
    2020-12-13 00:29

    Add the quotes along with the separator and then append the quotes to the front and back.

    "\"" + Joiner.on("\",\"").join(values) + "\""
    

提交回复
热议问题