Skip to content

Latest commit

 

History

History
114 lines (67 loc) · 2.17 KB

File metadata and controls

114 lines (67 loc) · 2.17 KB

Rhythm.Core

CollectionExtensionMethods StringSplitDelimiters
StringExtensionMethods

CollectionExtensionMethods

Extension methods for collections.

MakeSafe``1(items)

Converts a null collection into an empty collection.

Type Parameters

  • T - The type of item stored by the collection.
Name Description
items System.Collections.Generic.IEnumerable{``0}
The collection of items.

Returns

An empty list, if the supplied collection is null; otherwise, the supplied collection.

StringSplitDelimiters

The types of delimiters that can be used to split strings.

Comma

Split by commas.

Default

Default will split by common delimiters (e.g., commas, line breaks, semicolons).

LineBreak

Split by line breaks.

Semicolon

Split by semicolon.

StringExtensionMethods

Extension methods for strings.

#cctor

Static constructor.

CleanItems(items)

Cleans the collection of strings, trimming whitespace and removing empties.

Name Description
items System.Collections.Generic.IEnumerable{System.String}
The items to clean.

Returns

The cleaned strings.

SplitBy(source, delimiter)

Splits a string by the specified delimiter.

Name Description
source System.String
The string to split.
delimiter Rhythm.Core.Enums.StringSplitDelimiters
Optional. The delimiter. If unspecified, default delimiters will be used.

Returns

The split strings.

SplitByChars(source, characters)

Split a string by the specified characters.

Name Description
source System.String
The string to split.
characters System.Char[]
The characters to split by.

Returns

The split strings.

SplitByLineBreaks(source)

Split a string by line breaks.

Name Description
source System.String
The string to split.

Returns

The split strings.