Метод | Описание | |
---|---|---|
Base36DigitValue ( char c ) : int |
Gets the integer value for the specified digit, where 'A' maps to 10 and 'Z' maps to 35, or -1 if the character is not a digit or letter.
|
|
HexDigitValue ( char c ) : int |
Gets the integer value for the specified hex digit, or -1 if the character is not a hex digit.
|
|
SkipSpaces ( UString s ) : UString |
Returns a string with any spaces and tabs removed from the beginning. Only ' ' and '\t' are treated as spaces. |
|
TryParseDouble ( UString &source, int radix, ParseNumberFlag flags ) : double |
Parses a string to a double-precision float, returning NaN on failure or an infinity value on overflow.
|
|
TryParseFloat ( UString &source, int radix, ParseNumberFlag flags ) : float |
Parses a string to a single-precision float, returning NaN on failure or an infinity value on overflow.
|
|
TryParseFloatParts ( UString &source, int radix, bool &negative, ulong &mantissa, int &exponentBase2, int &exponentBase10, int &numDigits, ParseNumberFlag flags ) : bool |
Parses the parts of a floating-point string. See the other overload for details. This method is a wrapper around the other overload that combines the 'exponentBaseR' parameter with 'exponentBase2' or 'exponentBase10' depending on the radix. For example, when radix=10, this method adds |
|
TryParseFloatParts ( UString &source, int radix, bool &negative, ulong &mantissa, int &exponentBaseR, int &exponentBase2, int &exponentBase10, int &numDigits, ParseNumberFlag flags ) : bool |
Low-level method that identifies the parts of a float literal of arbitrary base (typically base 2, 10, or 16) with no prefix or suffix, such as The syntax required is |
|
TryParseHex ( UString s, int &value ) : bool |
A simple method to parse a sequence of hex digits, without overflow checks or other features supported by methods like TryParseInt(string, ref int, out int, int, bool).
|
|
TryParseHex ( UString &s, int &value ) : int |
A simple method to parse a sequence of hex digits, without overflow checks or other features supported by methods like TryParseInt(string, ref int, out int, int, bool).
|
|
TryParseInt ( UString &s, int &result, int radix = 10, ParseNumberFlag flags ) : bool | ||
TryParseInt ( UString &input, long &result, int radix = 10, ParseNumberFlag flags ) : bool | ||
TryParseInt ( string s, int &index, int &result, int radix = 10, bool skipSpaces = true ) : bool |
Tries to parse a string to an integer. Unlike Int32.TryParse(string, out int), this method allows parsing to start at any point in the string, it allows non-numeric data after the number, and it can parse numbers that are not in base 10. This method never throws. If parsing fails, index is left unchanged, except that spaces are still skipped if you set the skipSpaces flag. If base>36, parsing can succeed but digits above 35 (Z) cannot occur in the output number. If the input number cannot fit in 'result', the return value is false but index increases anyway, and 'result' is a bitwise truncated version of the number. |
|
TryParseUInt ( UString &s, System.Numerics.BigInteger &result, int radix = 10, ParseNumberFlag flags ) : bool | ||
TryParseUInt ( UString &s, ulong &result, int radix = 10, ParseNumberFlag flags ) : bool |
Tries to parse a string to an unsigned integer. This method never throws. It shrinks the slice |
|
UnescapeCStyle ( UString s, EscapeC &encountered, bool removeUnnecessaryBackslashes = false ) : StringBuilder |
Unescapes a string that uses C-style escape sequences, e.g. "\\\n\\\r" becomes "\n\r". See UnescapeChar(ref UString, ref EscapeC) for details. |
|
UnescapeCStyle ( UString s, bool removeUnnecessaryBackslashes = false ) : string |
Unescapes a string that uses C-style escape sequences, e.g. "\\\n\\\r" becomes "\n\r".
|
|
UnescapeChar ( UString &s ) : int | ||
UnescapeChar ( UString &s, EscapeC &encountered ) : int |
Unescapes a single character of a string. Returns the first character if it is not a backslash, or This function also decodes (non-escaped) surrogate pairs. |
|
UnescapeChar ( string s, int &i ) : int |
Метод | Описание | |
---|---|---|
SkipExtraDigits ( UString &s, int radix, ParseNumberFlag flags ) : int | ||
TryParseUInt ( UString &s, System.Numerics.BigInteger &result, int radix, ParseNumberFlag flags, int &numDigits ) : bool | ||
TryParseUInt ( UString &s, ulong &result, int radix, ParseNumberFlag flags, int &numDigits ) : bool |
public static Base36DigitValue ( char c ) : int | ||
c | char | |
Результат | int |
public static HexDigitValue ( char c ) : int | ||
c | char | |
Результат | int |
public static SkipSpaces ( UString s ) : UString | ||
s | UString | |
Результат | UString |
public static TryParseDouble ( UString &source, int radix, ParseNumberFlag flags ) : double | ||
source | UString | |
radix | int | Base of the number to parse; must be 2 (binary), /// 4, 8 (octal), 10 (decimal), 16 (hexadecimal) or 32. |
flags | ParseNumberFlag | Alters parsing behavior, see |
Результат | double |
public static TryParseFloat ( UString &source, int radix, ParseNumberFlag flags ) : float | ||
source | UString | |
radix | int | Base of the number to parse; must be 2 (binary), /// 4, 8 (octal), 10 (decimal), 16 (hexadecimal) or 32. |
flags | ParseNumberFlag | Alters parsing behavior, see |
Результат | float |
public static TryParseFloatParts ( UString &source, int radix, bool &negative, ulong &mantissa, int &exponentBase2, int &exponentBase10, int &numDigits, ParseNumberFlag flags ) : bool | ||
source | UString | |
radix | int | Base of the number to parse; must be 2 (binary), /// 4, 8 (octal), 10 (decimal), 16 (hexadecimal) or 32. |
negative | bool | true if the string began with '-'. |
mantissa | ulong | Integer magnitude of the number. |
exponentBase2 | int | Base-2 exponent to apply. |
exponentBase10 | int | Base-10 exponent to apply. |
numDigits | int | Set to the number of digits in the number, not including the exponent part. |
flags | ParseNumberFlag | Alters parsing behavior, see |
Результат | bool |
public static TryParseFloatParts ( UString &source, int radix, bool &negative, ulong &mantissa, int &exponentBaseR, int &exponentBase2, int &exponentBase10, int &numDigits, ParseNumberFlag flags ) : bool | ||
source | UString | |
radix | int | Base of the number to parse; must be between 2 /// and 36. |
negative | bool | |
mantissa | ulong | Integer magnitude of the number. |
exponentBaseR | int | Base-radix exponent to apply. This number
/// is based on the front part of the number only (not including the 'p' or
/// 'e' suffix). Negative values represent digits after the decimal point,
/// while positive numbers represent 64-bit overflow. For example, if the
/// input is |
exponentBase2 | int | Base-2 exponent to apply, as specified by /// the 'p' suffix, or 0 if there is no 'p' suffix.. |
exponentBase10 | int | Base-10 exponent to apply, as specified by /// the 'e' suffix, or 0 if there is no 'e' suffix.. |
numDigits | int | Set to the number of digits in the number, not /// including the exponent part. |
flags | ParseNumberFlag | Alters parsing behavior, see |
Результат | bool |
public static TryParseHex ( UString s, int &value ) : bool | ||
s | UString | |
value | int | |
Результат | bool |
public static TryParseHex ( UString &s, int &value ) : int | ||
s | UString | |
value | int | |
Результат | int |
public static TryParseInt ( UString &s, int &result, int radix = 10, ParseNumberFlag flags ) : bool | ||
s | UString | |
result | int | |
radix | int | |
flags | ParseNumberFlag | |
Результат | bool |
public static TryParseInt ( UString &input, long &result, int radix = 10, ParseNumberFlag flags ) : bool | ||
input | UString | |
result | long | |
radix | int | |
flags | ParseNumberFlag | |
Результат | bool |
public static TryParseInt ( string s, int &index, int &result, int radix = 10, bool skipSpaces = true ) : bool | ||
s | string | |
index | int | Location at which to start parsing |
result | int | |
radix | int | Number base, e.g. 10 for decimal and 2 for binary. /// Must be in the range 2 to 36. |
skipSpaces | bool | Whether to skip spaces before parsing. Only /// the ' ' and '\t' characters are treated as spaces. No space is allowed /// between '-' and the digits of a negative number, even with this flag. |
Результат | bool |
public static TryParseUInt ( UString &s, System.Numerics.BigInteger &result, int radix = 10, ParseNumberFlag flags ) : bool | ||
s | UString | |
result | System.Numerics.BigInteger | |
radix | int | |
flags | ParseNumberFlag | |
Результат | bool |
public static TryParseUInt ( UString &s, ulong &result, int radix = 10, ParseNumberFlag flags ) : bool | ||
s | UString | A slice of a string to be parsed. |
result | ulong | |
radix | int | Number base, e.g. 10 for decimal and 2 for binary. /// Normally in the range 2 to 36. |
flags | ParseNumberFlag | |
Результат | bool |
public static UnescapeCStyle ( UString s, EscapeC &encountered, bool removeUnnecessaryBackslashes = false ) : StringBuilder | ||
s | UString | |
encountered | EscapeC | Returns information about whether escape /// sequences were encountered, and which categories. |
removeUnnecessaryBackslashes | bool | Causes the backslash before /// an unrecognized escape sequence to be removed, e.g. "\z" => "z". |
Результат | StringBuilder |
public static UnescapeCStyle ( UString s, bool removeUnnecessaryBackslashes = false ) : string | ||
s | UString | |
removeUnnecessaryBackslashes | bool | |
Результат | string |
public static UnescapeChar ( UString &s ) : int | ||
s | UString | |
Результат | int |
public static UnescapeChar ( UString &s, EscapeC &encountered ) : int | ||
s | UString | Slice of a string to be unescaped. When using a
/// |
encountered | EscapeC | Bits of this parameter are set according /// to which escape sequence is encountered, if any. |
Результат | int |
public static UnescapeChar ( string s, int &i ) : int | ||
s | string | |
i | int | |
Результат | int |