Table of Contents

Class SHJoin

Namespace
SunamoStringJoin
Assembly
SunamoStringJoin.dll

String helper methods for joining strings and collections with delimiters.

public class SHJoin
Inheritance
SHJoin
Inherited Members
Extension Methods

Methods

IsNumber(string, string, bool)

Checks whether the input text represents a number.

public static bool IsNumber(string text, string mustContain, bool isInverting)

Parameters

text string

The text to check.

mustContain string

Required content parameter used by delegate signature.

isInverting bool

Whether to invert the result.

Returns

bool

Join(object, params string[])

Joins string parts with a delimiter object.

public static string Join(object delimiter, params string[] array)

Parameters

delimiter object

The delimiter object.

array string[]

The string parts to join.

Returns

string

Join(string, List<string>)

Joins a list of strings with a delimiter.

public static string Join(string delimiter, List<string> list)

Parameters

delimiter string

The delimiter to place between parts.

list List<string>

The list of strings to join.

Returns

string

The joined string.

JoinArray(object, params string[])

Joins string parts with a delimiter, validates correct argument order.

public static string JoinArray(object delimiter, params string[] array)

Parameters

delimiter object

The delimiter object.

array string[]

The string parts to join.

Returns

string

JoinChars(params char[])

Joins characters into a single string.

public static string JoinChars(params char[] characters)

Parameters

characters char[]

The characters to join.

Returns

string

JoinComma(params string[])

Joins string arguments with a comma delimiter.

public static string JoinComma(params string[] array)

Parameters

array string[]

The string arguments to join.

Returns

string

JoinDictionary(Dictionary<string, string>, string)

Joins a dictionary into a string with each entry on a new line.

public static string JoinDictionary(Dictionary<string, string> dictionary, string delimiter)

Parameters

dictionary Dictionary<string, string>

The dictionary to join.

delimiter string

The delimiter between key and value on each line.

Returns

string

JoinDictionary(IDictionary<string, string>, string, string)

Joins a dictionary into a string with specified delimiters between and after key-value pairs.

public static string JoinDictionary(IDictionary<string, string> dictionary, string delimiterBetweenKeyAndValue, string delimiterAfter)

Parameters

dictionary IDictionary<string, string>

The dictionary to join.

delimiterBetweenKeyAndValue string

The delimiter between each key and value.

delimiterAfter string

The delimiter after each key-value pair.

Returns

string

JoinFromIndex(int, object, IList)

Joins list elements from a specified start index with a delimiter, trimming the last delimiter character.

public static string JoinFromIndex(int startIndex, object delimiter, IList list)

Parameters

startIndex int

The index to start joining from.

delimiter object

The delimiter object.

list IList

The list of parts to join.

Returns

string

JoinKeyValueCollection(IList, IList, string, string)

Joins two parallel lists as key-value pairs with specified delimiters.

public static string JoinKeyValueCollection(IList keys, IList values, string delimiterBetweenKeyAndValue, string delimiterAfter)

Parameters

keys IList

The list of keys.

values IList

The list of values.

delimiterBetweenKeyAndValue string

The delimiter between each key and value.

delimiterAfter string

The delimiter after each key-value pair.

Returns

string

JoinMoreWords(object, params string[])

Joins words, wrapping non-number elements with quotes.

public static string JoinMoreWords(object delimiter, params string[] array)

Parameters

delimiter object

The delimiter object.

array string[]

The string parts to join.

Returns

string

JoinNL(List<string>, bool)

Joins a list of strings with newline characters.

public static string JoinNL(List<string> list, bool isRemovingLastNewline = false)

Parameters

list List<string>

The list of strings to join.

isRemovingLastNewline bool

Whether to remove the trailing newline.

Returns

string

The joined string.

JoinNLSb(StringBuilder, List<string>)

Joins a list of strings with newlines using a StringBuilder.

public static string JoinNLSb(StringBuilder stringBuilder, List<string> list)

Parameters

stringBuilder StringBuilder

The StringBuilder to use for joining.

list List<string>

The list of strings to join.

Returns

string

JoinSentences(bool, params string[])

Joins sentences, ensuring each ends with a period.

public static string JoinSentences(bool isAddingAfterLast, params string[] array)

Parameters

isAddingAfterLast bool

Whether to keep the period after the last sentence.

array string[]

The sentences to join.

Returns

string

JoinSpace(List<string>)

Joins a list of strings with a space delimiter.

public static string JoinSpace(List<string> list)

Parameters

list List<string>

The list of strings to join.

Returns

string

JoinString(object, List<string>)

Joins a list of strings with a delimiter. Wrapper for Join(string, List<string>).

public static string JoinString(object delimiter, List<string> list)

Parameters

delimiter object

The delimiter object.

list List<string>

The list of strings to join.

Returns

string

JoinString(string, List<string>)

Joins a list of strings with a delimiter. Wrapper for Join(string, List<string>).

public static string JoinString(string delimiter, List<string> list)

Parameters

delimiter string

The delimiter to place between parts.

list List<string>

The list of strings to join.

Returns

string

JoinStringExceptIndexes(object, IList, params int[])

Joins list elements with a delimiter, excluding elements at specified indexes.

public static string JoinStringExceptIndexes(object delimiter, IList list, params int[] excludedIndexes)

Parameters

delimiter object

The delimiter object.

list IList

The list of parts to join.

excludedIndexes int[]

The indexes to exclude from joining.

Returns

string

JoinStringParams(object, params string[])

Joins string parts with a delimiter. Wrapper for Join(object, params string[]).

public static string JoinStringParams(object delimiter, params string[] array)

Parameters

delimiter object

The delimiter object.

array string[]

The string parts to join.

Returns

string

JoinTimes(int, string)

Repeats a text a specified number of times.

public static string JoinTimes(int times, string text)

Parameters

times int

The number of repetitions.

text string

The text to repeat.

Returns

string

JoinToIndex(int, object, IList)

Joins list elements up to a specified end index (exclusive) with a delimiter.

public static string JoinToIndex(int endIndex, object delimiter, IList list)

Parameters

endIndex int

The exclusive end index.

delimiter object

The delimiter object.

list IList

The list of parts to join.

Returns

string

JoinWithoutEndTrimDelimiter(object, params string[])

Joins string parts with a delimiter without trimming the end delimiter.

public static string JoinWithoutEndTrimDelimiter(object delimiter, params string[] array)

Parameters

delimiter object

The delimiter object.

array string[]

The string parts to join.

Returns

string

JoinWithoutTrim(object, IList)

Joins list elements with a delimiter without trimming the end.

public static string JoinWithoutTrim(object delimiter, IList list)

Parameters

delimiter object

The delimiter object.

list IList

The list of parts to join.

Returns

string