Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 537 Bytes

GCop131.md

File metadata and controls

19 lines (12 loc) · 537 Bytes

GCop 131

"Use {collectionName}.ToString({seperator}) instead of {string.Join}({seperator}, {collectionName})"

Rule description

The string.Tostring("separator") places the separator between every element of the collection in the returned string. The separator is not added to the start or end of the result. It is just like string.join() but briefer and more readable.

Example

var result = string.Join(",", myCollection);

should be 🡻

var result = myCollection.ToString(",");