C# Класс GSF.CharExtensions

Defines extension functions related to character manipulation.
Показать файл Открыть проект

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

Метод Описание
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