Table of Contents

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

separator char

The character to use as a separator. separator is included in the returned string only if values has more than one element.

values IEnumerable<T>

A collection that contains the objects to concatenate.

Returns

LazyEncodedString

A string that consists of the members of values delimited by the separator character.

-or-

Empty if values has no elements.

Type Parameters

T

The 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

values is 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

separator char

Separator character

values IEnumerable<LazyEncodedString>

Values to join together

Returns

LazyEncodedString

Result of the joined set of values