C# Класс Material.EBDeployer.DeployLogic.Extensions.StringExtensions

Показать файл Открыть проект

Открытые методы

Метод Описание
Clean ( this str, List oldValues, string newValue ) : string

Given a list of values to replace, it looks them up and replaces them with the newValue.

Contains ( this source, string toCheck, System.StringComparison comparison ) : bool
DoubleParseOrDefault ( this doubleString, double defaultValue ) : double

Attempts to parse a string into an Double value, if the parse is not successful, then the given defaultValue is returned.

EmptyToNull ( this value ) : string
Int32ParseOrDefault ( this intString, int defaultValue ) : int

Attempts to parse a string into an Int32 value, if the parse is not successful, then the given defaultValue is returned.

IsEqualIgnoreCase ( this s1, string s2 ) : bool

Checks if the two strings are equal ignoring casing.

Split ( this input, string separator ) : IEnumerable
Trim ( this inputs, char trimCharacters = null ) : IEnumerable
TrimEnd ( this source, string value ) : string

Removes the string value from the end of the source string iff the source string ends with the value string.

Truncate ( this value, int length ) : string

Truncates a string to the supplied length if the current length of the string exceeds the given length parameter.

Описание методов

Clean() публичный статический Метод

Given a list of values to replace, it looks them up and replaces them with the newValue.
public static Clean ( this str, List oldValues, string newValue ) : string
str this
oldValues List List of old values to replace
newValue string Value that will replace each occurance of the old values.
Результат string

Contains() публичный статический Метод

public static Contains ( this source, string toCheck, System.StringComparison comparison ) : bool
source this
toCheck string
comparison System.StringComparison
Результат bool

DoubleParseOrDefault() публичный статический Метод

Attempts to parse a string into an Double value, if the parse is not successful, then the given defaultValue is returned.
public static DoubleParseOrDefault ( this doubleString, double defaultValue ) : double
doubleString this String that will be parsed
defaultValue double Value that is returned if string is not parsable
Результат double

EmptyToNull() публичный статический Метод

public static EmptyToNull ( this value ) : string
value this
Результат string

Int32ParseOrDefault() публичный статический Метод

Attempts to parse a string into an Int32 value, if the parse is not successful, then the given defaultValue is returned.
public static Int32ParseOrDefault ( this intString, int defaultValue ) : int
intString this String that will be parsed
defaultValue int Value that is returned if string is not parsable
Результат int

IsEqualIgnoreCase() публичный статический Метод

Checks if the two strings are equal ignoring casing.
public static IsEqualIgnoreCase ( this s1, string s2 ) : bool
s1 this
s2 string
Результат bool

Split() публичный статический Метод

public static Split ( this input, string separator ) : IEnumerable
input this
separator string
Результат IEnumerable

Trim() публичный статический Метод

public static Trim ( this inputs, char trimCharacters = null ) : IEnumerable
inputs this
trimCharacters char
Результат IEnumerable

TrimEnd() публичный статический Метод

Removes the string value from the end of the source string iff the source string ends with the value string.
public static TrimEnd ( this source, string value ) : string
source this
value string
Результат string

Truncate() публичный статический Метод

Truncates a string to the supplied length if the current length of the string exceeds the given length parameter.
Thrown when value is null.
public static Truncate ( this value, int length ) : string
value this A string.
length int The number of characters to truncate the string at.
Результат string