public unsafe static bool TryParseInt32(byte *text, int length, out int value) { int consumed; var span = new ReadOnlySpan <byte>(text, length); return(PrimitiveParser.TryParseInt32(span, out value, out consumed, EncodingData.InvariantUtf8, 'X')); }
public static bool TryParseInt32(ReadOnlySpan <char> text, out int value) { int consumed; var byteSpan = text.Cast <char, byte>(); return(PrimitiveParser.TryParseInt32(byteSpan, out value, out consumed, EncodingData.InvariantUtf16, 'X')); }
public static bool TryParseInt32(ReadOnlySpan <char> text, out int value, out int charactersConsumed) { var byteSpan = text.Cast <char, byte>(); int bytesConsumed; bool result = PrimitiveParser.TryParseInt32(byteSpan, out value, out bytesConsumed, EncodingData.InvariantUtf16, 'X'); charactersConsumed = bytesConsumed / sizeof(char); return(result); }
public unsafe static bool TryParseInt32(char *text, int length, out int value, out int charactersConsumed) { var span = new ReadOnlySpan <byte>(text, length * sizeof(char)); int bytesConsumed; bool result = PrimitiveParser.TryParseInt32(span, out value, out bytesConsumed, EncodingData.InvariantUtf16, 'X'); charactersConsumed = bytesConsumed / sizeof(char); return(result); }
public static bool TryParseInt32(ReadOnlySpan <byte> text, out int value, out int bytesConsumed) { return(PrimitiveParser.TryParseInt32(text, out value, out bytesConsumed, EncodingData.InvariantUtf8, 'X')); }