C# Class Material.EBDeployer.DeployLogic.Extensions.StringExtensions

Afficher le fichier Open project: MaterialDev/elastic-beanstalk-deploy

Méthodes publiques

Méthode Description
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.

Method Details

Clean() public static méthode

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.
Résultat string

Contains() public static méthode

public static Contains ( this source, string toCheck, System.StringComparison comparison ) : bool
source this
toCheck string
comparison System.StringComparison
Résultat bool

DoubleParseOrDefault() public static méthode

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
Résultat double

EmptyToNull() public static méthode

public static EmptyToNull ( this value ) : string
value this
Résultat string

Int32ParseOrDefault() public static méthode

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
Résultat int

IsEqualIgnoreCase() public static méthode

Checks if the two strings are equal ignoring casing.
public static IsEqualIgnoreCase ( this s1, string s2 ) : bool
s1 this
s2 string
Résultat bool

Split() public static méthode

public static Split ( this input, string separator ) : IEnumerable
input this
separator string
Résultat IEnumerable

Trim() public static méthode

public static Trim ( this inputs, char trimCharacters = null ) : IEnumerable
inputs this
trimCharacters char
Résultat IEnumerable

TrimEnd() public static méthode

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
Résultat string

Truncate() public static méthode

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.
Résultat string