Table of Contents

Class StringExtensions

Namespace
OneImlx.Shared.Extensions
Assembly
OneImlx.Shared.dll

string extension methods.

public static class StringExtensions
Inheritance
StringExtensions
Inherited Members

Methods

EmptyIfNull(string?)

Returns an empty string if this string is null.

public static string EmptyIfNull(this string? self)

Parameters

self string

The string to check.

Returns

string

true if string is not null or white space, otherwise false.

IsNotNullOrWhiteSpace(string?)

Determines if the string is not null or white space.

public static bool IsNotNullOrWhiteSpace(this string? self)

Parameters

self string

The string to check.

Returns

bool

true if string is not null or white space, otherwise false.

IsNullOrEmpty(string?)

Determines if the string is null or empty.

public static bool IsNullOrEmpty(this string? self)

Parameters

self string

The string to check.

Returns

bool

true if string is null or empty, otherwise false.

IsNullOrWhiteSpace(string?)

Determines if the string is null or white space.

public static bool IsNullOrWhiteSpace(this string? self)

Parameters

self string

The string to check.

Returns

bool

true if string is null or empty, otherwise false.

JoinByComma(IEnumerable<string>?)

Joins the string collection with a , separator.

public static string JoinByComma(this IEnumerable<string>? list)

Parameters

list IEnumerable<string>

A collection of string to join.

Returns

string

A joined string.

JoinByNewline(IEnumerable<string>?)

Joins the string collection with a NewLine separator.

public static string JoinByNewline(this IEnumerable<string>? list)

Parameters

list IEnumerable<string>

A collection of string to join.

Returns

string

A joined string.

JoinBySpace(IEnumerable<string>?)

Joins the string collection with a space separator.

public static string JoinBySpace(this IEnumerable<string>? list)

Parameters

list IEnumerable<string>

A collection of string to join.

Returns

string

A joined string.

NotNull(string?)

Returns a non null string.

public static string NotNull(this string? self)

Parameters

self string

The string to check.

Returns

string

true if string is not null or white space, otherwise false.

Repeat(string, int)

Repeats the string for the specified times.

public static string Repeat(this string value, int count)

Parameters

value string

The value to repeat.

count int

The count.

Returns

string

New repeated string.

SplitByComma(string?)

Splits the string with a , separator.

public static string[] SplitByComma(this string? self)

Parameters

self string

The string to split.

Returns

string[]

An array of string split by , separator.

SplitByNewline(string?)

Splits the string with a NewLine.

public static string[] SplitByNewline(this string? self)

Parameters

self string

The string to split.

Returns

string[]

An array of string split by newline separator.

SplitBySpace(string?)

Splits the string with a space separator.

public static string[] SplitBySpace(this string? self)

Parameters

self string

The string to split.

Returns

string[]

An array of string split by space separator.

TrimEnd(string, string?, StringComparison)

Removes the trailing occurrence of a string recursively.

public static string TrimEnd(this string self, string? trim, StringComparison stringComparison)

Parameters

self string

The string to trim.

trim string

The string to trim from start.

stringComparison StringComparison

The string comparison.

Returns

string

TrimStart(string, string?, StringComparison)

Removes the leading occurrence of a string recursively.

public static string TrimStart(this string self, string? trim, StringComparison stringComparison)

Parameters

self string

The string to trim.

trim string

The string to trim from start.

stringComparison StringComparison

The string comparison.

Returns

string