C# 클래스 EnergyTrading.Extensions.StringExtensions

파일 보기 프로젝트 열기: RWE-Nexus/EnergyTrading-Core

공개 메소드들

메소드 설명
AppendValueToEndIfMissing ( this source, string value ) : string

Append the value to the source if the source is not null/whitespace and the source does not end with the value.

DefaultIfNullOrEmpty ( this source, string defaultValue ) : string

Return the default value if the source value is null or empty.

Matches ( this validValues, string itemToMatch ) : bool

checks to see if a supplied string matches with any item in the list allows for the following simple logic all currently case-insensitive * or *.* => match all items *xxx or *.xxx => EndsWith("xxx") xxx* or xxx.* => StartsWith("xxx") *xxx* or *.xxx.* => Contains("xxx") xxx => string.Compare() == 0

Matches ( this validValues, string itemToMatch, int &noOfMatchedCharacters ) : bool

checks to see if a supplied string matches with any item in the list allows for the following simple logic all currently case-insensitive * or *.* => match all items *xxx or *.xxx => EndsWith("xxx") xxx* or xxx.* => StartsWith("xxx") *xxx* or *.xxx.* => Contains("xxx") xxx => string.Compare() == 0

메소드 상세

AppendValueToEndIfMissing() 공개 정적인 메소드

Append the value to the source if the source is not null/whitespace and the source does not end with the value.
public static AppendValueToEndIfMissing ( this source, string value ) : string
source this Value to check.
value string Value to append
리턴 string

DefaultIfNullOrEmpty() 공개 정적인 메소드

Return the default value if the source value is null or empty.
public static DefaultIfNullOrEmpty ( this source, string defaultValue ) : string
source this Value to check
defaultValue string Default value
리턴 string

Matches() 공개 정적인 메소드

checks to see if a supplied string matches with any item in the list allows for the following simple logic all currently case-insensitive * or *.* => match all items *xxx or *.xxx => EndsWith("xxx") xxx* or xxx.* => StartsWith("xxx") *xxx* or *.xxx.* => Contains("xxx") xxx => string.Compare() == 0
public static Matches ( this validValues, string itemToMatch ) : bool
validValues this the list of expressions to match against
itemToMatch string the string to match
리턴 bool

Matches() 공개 정적인 메소드

checks to see if a supplied string matches with any item in the list allows for the following simple logic all currently case-insensitive * or *.* => match all items *xxx or *.xxx => EndsWith("xxx") xxx* or xxx.* => StartsWith("xxx") *xxx* or *.xxx.* => Contains("xxx") xxx => string.Compare() == 0
public static Matches ( this validValues, string itemToMatch, int &noOfMatchedCharacters ) : bool
validValues this the list of expressions to match against
itemToMatch string the string to match
noOfMatchedCharacters int out parameter that returns the number of characters that was actually matched
리턴 bool