Class Joiner<T>
- Namespace
- SunamoCollectionsGeneric.Collections
- Assembly
- SunamoCollectionsGeneric.dll
Helper class for building a string by joining items with a separator
public class Joiner<T>
Type Parameters
TThe type of items to join
- Inheritance
-
Joiner<T>
- Inherited Members
- Extension Methods
Constructors
Joiner()
Initializes a new instance with comma as the default separator
public Joiner()
Joiner(string, int)
Initializes a new instance with the specified separator and capacity
public Joiner(string joinWith, int capacity = 5)
Parameters
joinWithstringThe separator string to use when joining items
capacityintThe initial capacity of the internal list
Methods
Add(T)
Adds a value to the collection
public void Add(T value)
Parameters
valueTThe value to add
ToString()
Returns a string that represents the joined items
public override string ToString()
Returns
- string
A string with all items joined by the separator