C# 클래스 GSF.CharExtensions

Defines extension functions related to character manipulation.
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf

공개 메소드들

메소드 설명
IsAnyOf ( this value, IEnumerable testChars ) : bool

Determines if a character matches any character in a sent array.

IsInRange ( this value, char startOfRange, char endOfRange ) : bool

Tests a character to determine if it is between a specified character range

IsNumeric ( this value ) : bool

Tests a character to determine if is a common part of a numeric string (digits or one of "+ - , .")

IsWordTerminator ( this value ) : bool

Tests a character to determine if it marks the end of a typical English word.

Performs no testing for ASCII codes > 127.
Does not separate words based on punctuation of ' % - _
However does include the angle bracket symbols < > as separators

For reference the standard char tests are:

  • "IsSperator (1) == simple space (32 or 160) only.
  • IsPunctuation (23) == . , ! ? : ; " ' [ ] { } ( ) \ / @ % # * & - _ (plus other char's > 127)
  • IsSymbol (8) == $ + < > = ^ ` ~
  • IsWhiteSpace (6) == control char's 9 thru 13, plus 32 -- TAB, LF, VT, FF, CR, SP
RegexEncode ( this item ) : string

Encodes the specified Unicode character in proper Regular Expression format.

메소드 상세

IsAnyOf() 공개 정적인 메소드

Determines if a character matches any character in a sent array.
public static IsAnyOf ( this value, IEnumerable testChars ) : bool
value this The character to check.
testChars IEnumerable The array of characters to test.
리턴 bool

IsInRange() 공개 정적인 메소드

Tests a character to determine if it is between a specified character range
public static IsInRange ( this value, char startOfRange, char endOfRange ) : bool
value this Input character to process.
startOfRange char Beginning of range character.
endOfRange char End of range character.
리턴 bool

IsNumeric() 공개 정적인 메소드

Tests a character to determine if is a common part of a numeric string (digits or one of "+ - , .")
public static IsNumeric ( this value ) : bool
value this The character to check.
리턴 bool

IsWordTerminator() 공개 정적인 메소드

Tests a character to determine if it marks the end of a typical English word.
Performs no testing for ASCII codes > 127.
Does not separate words based on punctuation of ' % - _
However does include the angle bracket symbols < > as separators

For reference the standard char tests are:
  • "IsSperator (1) == simple space (32 or 160) only.
  • IsPunctuation (23) == . , ! ? : ; " ' [ ] { } ( ) \ / @ % # * & - _ (plus other char's > 127)
  • IsSymbol (8) == $ + < > = ^ ` ~
  • IsWhiteSpace (6) == control char's 9 thru 13, plus 32 -- TAB, LF, VT, FF, CR, SP
public static IsWordTerminator ( this value ) : bool
value this Input character to check.
리턴 bool

RegexEncode() 공개 정적인 메소드

Encodes the specified Unicode character in proper Regular Expression format.
public static RegexEncode ( this item ) : string
item this Unicode character to encode in Regular Expression format.
리턴 string