Method Join
- Namespace
- Ubiquity.NET.InteropHelpers
- Assembly
- Ubiquity.NET.InteropHelpers.dll
Join<T>(char, params IEnumerable<T>)
Concatenates the members of a collection, using the specified separator between each member.
public static LazyEncodedString Join<T>(char separator, params IEnumerable<T> values)
Parameters
separatorcharThe character to use as a separator.
separatoris included in the returned string only ifvalueshas more than one element.valuesIEnumerable<T>A collection that contains the objects to concatenate.
Returns
- LazyEncodedString
A string that consists of the members of
valuesdelimited by theseparatorcharacter.-or-
Empty if
valueshas no elements.
Type Parameters
TThe type of the members of
values.
Remarks
This will join the managed form of any LazyEncodedString (Technically the results of calling ToString() on each value provided) to produce a final joined string. The result will only have the managed form created but will lazily provide the managed form if/when needed (conversion still only happens once).
Exceptions
- ArgumentNullException
valuesis null.- OutOfMemoryException
The length of the resulting string overflows the maximum allowed length (Int32.MaxValue).
Join(char, params IEnumerable<LazyEncodedString>)
Specialized join that optimizes for LazyEncodedString values
public static LazyEncodedString Join(char separator, params IEnumerable<LazyEncodedString> values)
Parameters
separatorcharSeparator character
valuesIEnumerable<LazyEncodedString>Values to join together
Returns
- LazyEncodedString
Result of the joined set of values