14 internal static char[]
crt =
new char[3] {
'\n',
'\r',
'\t' };
22 internal static readonly
char[]
WhitespaceChars =
new char[4] {
' ',
'\t',
'\n',
'\r' };
57 if (
string.IsNullOrEmpty(
name))
97 if (
name[
i + 6] !=
'_')
140 if (
string.IsNullOrEmpty(
name))
288 if (
name.Length == 0)
293 if (num !=
name.Length)
302 if (
string.IsNullOrEmpty(
name))
307 if (num !=
name.Length)
316 if (
string.IsNullOrEmpty(
name))
322 if (num !=
name.Length)
340 if (
name.Length == 0)
345 if (num !=
name.Length)
355 if (num == 0 || num !=
name.Length)
365 if (
string.IsNullOrEmpty(token))
369 if (token[0] ==
' ' || token[token.Length - 1] ==
' ' || token.IndexOfAny(
crt) != -1 || token.IndexOf(
" ",
StringComparison.Ordinal) != -1)
378 if (token ==
null || token.Length == 0)
382 if (token[0] ==
' ' || token[token.Length - 1] ==
' ' || token.IndexOfAny(
crt) != -1 || token.IndexOf(
" ",
StringComparison.Ordinal) != -1)
400 if (
name.Length == 0)
405 if (num !=
name.Length)
414 if (
name ==
null ||
name.Length == 0)
419 if (num !=
name.Length)
428 if (
str.IndexOfAny(
crt) != -1)
447 if (publicId ==
null)
518 return value.ToString();
572 if (
float.IsNegativeInfinity(
value))
576 if (
float.IsPositiveInfinity(
value))
589 if (
double.IsNegativeInfinity(
value))
593 if (
double.IsPositiveInfinity(
value))
609 [
Obsolete(
"Use XmlConvert.ToString() that accepts an XmlDateTimeSerializationMode instead.")]
653 return value.ToString();
706 if (!
char.TryParse(
s,
out result))
862 return float.NegativeInfinity;
866 return float.PositiveInfinity;
869 if (num == 0f &&
s[0] ==
'-')
881 result =
float.NegativeInfinity;
886 result =
float.PositiveInfinity;
893 if (result == 0f &&
s[0] ==
'-')
905 return double.NegativeInfinity;
909 return double.PositiveInfinity;
912 if (num == 0.0 &&
s[0] ==
'-')
924 result =
double.NegativeInfinity;
929 result =
double.PositiveInfinity;
936 if (result == 0.0 &&
s[0] ==
'-')
1006 if (
value - num != 0.5)
1045 "yyyy-MM-ddTHH:mm:ss.FFFFFFFzzzzzz",
"yyyy-MM-ddTHH:mm:ss.FFFFFFF",
"yyyy-MM-ddTHH:mm:ss.FFFFFFFZ",
"HH:mm:ss.FFFFFFF",
"HH:mm:ss.FFFFFFFZ",
"HH:mm:ss.FFFFFFFzzzzzz",
"yyyy-MM-dd",
"yyyy-MM-ddZ",
"yyyy-MM-ddzzzzzz",
"yyyy-MM",
1046 "yyyy-MMZ",
"yyyy-MMzzzzzz",
"yyyy",
"yyyyZ",
"yyyyzzzzzz",
"--MM-dd",
"--MM-ddZ",
"--MM-ddzzzzzz",
"---dd",
"---ddZ",
1047 "---ddzzzzzz",
"--MM--",
"--MM--Z",
"--MM--zzzzzz"
1052 [
Obsolete(
"Use XmlConvert.ToDateTime() that accepts an XmlDateTimeSerializationMode instead.")]
1130 result =
new Guid(
s);
1167 if (!
string.IsNullOrEmpty(
s))
1185 if (
s !=
null &&
s.Length > 0)
1254 if (data ==
null || data.Length == 0)
1259 int length = data.Length;
1271 char ch = data[num];
1293 if (data ==
null ||
len == 0)
1310 char ch = data[num];
1315 if (num + 1 ==
num2)
1338 if (c <
' ' || c ==
'"')
1431 string[]
array =
new string[2];
static unsafe long DoubleToInt64Bits(double value)
static ? string ToString(object? value)
static double ToDouble(object? value)
static CultureInfo InvariantCulture
static int FromChar(int c)
static decimal Round(decimal d)
static string Sch_NotTokenString
static string Xml_EmptyName
static string Xml_BadStartNameChar
static string Format(string resourceFormat, object p1)
static string Xml_InvalidSurrogatePairWithArgs
static string Xml_InvalidSurrogateHighChar
static string Xml_InvalidNmToken
static string Xml_InvalidSurrogateMissingLowChar
static string Sch_InvalidDateTimeOption
static string Xml_EmptyLocalName
static string Xml_InvalidCharacter
static string XmlConvert_BadFormat
static string Xml_InvalidWhitespaceCharacter
static string Xml_BadNameChar
static string XmlConvert_NotOneCharString
static string Sch_NotNormalizedString
static bool TryCreate([NotNullWhen(true)] string? uriString, UriKind uriKind, [NotNullWhen(true)] out Uri? result)
override int Decode(char[] chars, int startPos, int len)
static void Encode(byte[] buffer, int index, int count, XmlWriter writer)
static int ParseNameNoNamespaces(string s, int offset)
static Exception GetInvalidNameException(string s, int offsetStartChar, int offsetBadChar)
static int ParseQName(string s, int offset, out int colonOffset)
static int ParseNmtokenNoNamespaces(string s, int offset)
static int ParseNCName(string s, int offset)
static bool IsNCNameCharXml4e(char ch)
static void SplitSurrogateChar(int combinedChar, out char lowChar, out char highChar)
static bool IsStartNCNameSingleChar(char ch)
static int IsOnlyWhitespaceWithPos(string str)
static bool IsNameCharXml4e(char ch)
static bool IsNCNameSingleChar(char ch)
static bool IsWhiteSpace(char ch)
static bool IsLowSurrogate(int ch)
static bool IsPubidChar(char ch)
static bool IsStartNCNameCharXml4e(char ch)
static int CombineSurrogateChar(int lowChar, int highChar)
static bool IsCharData(char ch)
static bool IsHighSurrogate(int ch)
static int IsPublicId(string str)
static Exception TryVerifyNormalizedString(string str)
static bool ToBoolean(string s)
static string TrimStringEnd(string value)
static bool IsWhitespaceChar(char ch)
static double ToXPathDouble(object o)
static Exception TryVerifyTOKEN(string token)
static string TrimStringStart(string value)
static DateTimeOffset ToDateTimeOffset(string s)
static string VerifyNCName(string name, ExceptionType exceptionType)
static Exception CreateInvalidNameCharException(string name, int index, ExceptionType exceptionType)
static uint ToUInt32(string s)
static bool IsNegativeZero(double value)
static string ToString(sbyte value)
static Exception TryToByte(string s, out byte result)
static string ToString(int value)
static string[] SplitString(string value)
static DateTime SwitchToUtcTime(DateTime value)
static ? string VerifyTOKEN(string? token)
static string ToString(uint value)
static Exception CreateException(string res, string[] args, ExceptionType exceptionType)
static Exception TryVerifyNMTOKEN(string name)
static string ToBinHexString(byte[] inArray)
static string ToString(long value)
static ? string EncodeName(string? name)
static DateTime SwitchToLocalTime(DateTime value)
static void VerifyCharData(string data, ExceptionType exceptionType)
static ? string DecodeName(string? name)
static string ToString(float value)
static int ToInt32(string s)
static string[] SplitString(string value, StringSplitOptions splitStringOptions)
static string ToString(ushort value)
static short ToInt16(string s)
static Exception TryToBoolean(string s, out bool result)
static DateTime ToDateTime(string s, XmlDateTimeSerializationMode dateTimeOption)
static string ToString(bool value)
static Exception CreateException(string res, string arg, ExceptionType exceptionType)
static string TrimString(string value)
static Exception CreateInvalidCharException(string data, int invCharPos)
static byte[] FromBinHexString(string s, bool allowOddCount)
static string ToString(double value)
static float ToSingle(string s)
static ArgumentException CreateInvalidNameArgumentException(string name, string argumentName)
static string[] AllDateTimeFormats
static DateTime ToDateTime(string s, string[] formats)
static Exception TryToDouble(string s, out double result)
static TimeSpan ToTimeSpan(string s)
static string ToString(DateTime value, XmlDateTimeSerializationMode dateTimeOption)
static string EncodeName(string name, bool first, bool local)
static bool IsXmlChar(char ch)
static Exception CreateInvalidCharException(string data, int invCharPos, ExceptionType exceptionType)
static string VerifyName(string name)
static Exception TryToDecimal(string s, out decimal result)
static readonly CultureInfo s_invariantCultureInfo
static Exception TryToSingle(string s, out float result)
static ? string EncodeLocalName(string? name)
static char ToChar(string s)
static string ToXPathString(object value)
static readonly char[] WhitespaceChars
static Exception TryToUInt64(string s, out ulong result)
static Exception CreateInvalidCharException(char invChar, char nextChar)
static int FromHex(char digit)
static string ToString(ulong value)
static string VerifyNCName(string name)
static double ToDouble(string s)
static string ToString(decimal value)
static Exception TryToInt32(string s, out int result)
static DateTime ToDateTime(string s, string format)
static Exception TryToSByte(string s, out sbyte result)
static volatile string[] s_allDateTimeFormats
static Exception TryToTimeSpan(string s, out TimeSpan result)
static string ToString(TimeSpan value)
static Exception CreateInvalidCharException(char[] data, int length, int invCharPos, ExceptionType exceptionType)
static Exception CreateException(string res, string[] args, ExceptionType exceptionType, int lineNo, int linePos)
static string ToString(Guid value)
static Exception TryToInteger(string s, out decimal result)
static Exception TryToUInt32(string s, out uint result)
static sbyte ToSByte(string s)
static Exception TryToInt64(string s, out long result)
static void CreateAllDateTimeFormats()
static Exception TryToUri(string s, out Uri result)
static Exception CreateInvalidSurrogatePairException(char low, char hi, ExceptionType exceptionType, int lineNo, int linePos)
static Exception TryToInt16(string s, out short result)
static string ToString(DateTimeOffset value)
static string ToString(char value)
static string VerifyPublicId(string publicId)
static string VerifyWhitespace(string content)
static string ToString(byte value)
static bool IsXmlSurrogatePair(char lowChar, char highChar)
static Exception TryToUInt16(string s, out ushort result)
static Guid ToGuid(string s)
static Uri ToUri(string s)
static void VerifyCharData(string data, ExceptionType invCharExceptionType, ExceptionType invSurrogateExceptionType)
static Exception TryToChar(string s, out char result)
static Exception TryToGuid(string s, out Guid result)
static ? string EncodeNmToken(string? name)
static volatile Regex s_decodeCharPattern
static DateTimeOffset ToDateTimeOffset(string s, string[] formats)
static Exception CreateInvalidSurrogatePairException(char low, char hi)
static string ToString(DateTimeOffset value, string format)
static bool IsPublicIdChar(char ch)
static bool StrEqual(char[] chars, int strPos1, int strLen1, string str2)
static Exception CreateInvalidSurrogatePairException(char low, char hi, ExceptionType exceptionType)
static string ToString(short value)
static DateTime ToDateTime(string s)
static volatile Regex s_encodeCharPattern
static void VerifyCharData(char[] data, int offset, int len, ExceptionType exceptionType)
static decimal ToDecimal(string s)
static Exception CreateInvalidHighSurrogateCharException(char hi, ExceptionType exceptionType)
static string ToString(DateTime value, string format)
static Exception CreateException(string res, string arg, ExceptionType exceptionType, int lineNo, int linePos)
static byte[] FromBinHexString(string s)
static Exception CreateInvalidHighSurrogateCharException(char hi, ExceptionType exceptionType, int lineNo, int linePos)
static ulong ToUInt64(string s)
static string EscapeValueForDebuggerDisplay(string value)
static ushort ToUInt16(string s)
static Exception TryVerifyName(string name)
static Exception CreateInvalidHighSurrogateCharException(char hi)
static bool IsStartNCNameChar(char ch)
static decimal ToInteger(string s)
static byte ToByte(string s)
static Exception CreateInvalidCharException(char invChar, char nextChar, ExceptionType exceptionType)
static string VerifyXmlChars(string content)
static string VerifyNMTOKEN(string name)
static string VerifyQName(string name, ExceptionType exceptionType)
static Exception CreateException(string res, ExceptionType exceptionType, int lineNo, int linePos)
static string VerifyNMTOKEN(string name, ExceptionType exceptionType)
static Exception TryVerifyNCName(string name)
static double XPathRound(double value)
static long ToInt64(string s)
static string ToString(DateTime value)
static DateTimeOffset ToDateTimeOffset(string s, string format)
static bool IsNCNameChar(char ch)
static string[] BuildCharExceptionArgs(string data, int invCharIndex)
XmlDateTimeSerializationMode
static DateTimeOffset ParseExact(string input, string format, IFormatProvider? formatProvider)
static DateTime ParseExact(string s, string format, IFormatProvider? provider)
static readonly Guid Empty
void AppendFormatted(ReadOnlySpan< char > value)
static readonly TimeSpan MinValue
override string ToString()
static Exception TryParse(string s, out XsdDuration result)
override string ToString()