Join a string using delimiters

后端 未结 24 1591
北海茫月
北海茫月 2020-12-05 09:57

What is the best way to join a list of strings into a combined delimited string. I\'m mainly concerned about when to stop adding the delimiter. I\'ll use C# for my example

24条回答
  •  抹茶落季
    2020-12-05 10:48

    There's little reason to make it language-agnostic when some languages provide support for this in one line, e.g., Python's

    ",".join(sequence)
    

    See the join documentation for more info.

提交回复
热议问题