Class IntToTextConverter
- Namespace
- Switchboard
- Assembly
- Switchboard.TextConverter.dll
Converts integral numbers into strings of characters, without allocating memory for garbage collection.
public static class IntToTextConverter
- Inheritance
-
IntToTextConverter
Fields
MaxCharacterCount
Gets the maximum number of characters that may be necessary to store the text representation of a number.
public const int MaxCharacterCount = 71
Methods
ConvertToText(byte, Span<char>)
Converts a byte into a Span<T> of characters.
public static int ConvertToText(this byte value, Span<char> result)
Parameters
value
byteThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(short, Span<char>)
Converts a short integer into a Span<T> of characters.
public static int ConvertToText(this short value, Span<char> result)
Parameters
value
shortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(short, Span<char>, char)
Converts a short integer into a Span<T> of characters.
public static int ConvertToText(this short value, Span<char> result, char digitGroupSeparator)
Parameters
value
shortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(int, Span<char>)
Converts an integer into a Span<T> of characters.
public static int ConvertToText(this int value, Span<char> result)
Parameters
value
intThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(int, Span<char>, out bool)
Converts an integer into a Span<T> of characters, without a negative sign.
public static int ConvertToText(this int value, Span<char> result, out bool valueIsNegative)
Parameters
value
intThe number to convert.
result
Span<char>The target to contain the result of the conversion.
valueIsNegative
boolThe value will be true if the
value
is a negative number.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(int, Span<char>, char)
Converts an integer into a Span<T> of characters.
public static int ConvertToText(this int value, Span<char> result, char digitGroupSeparator)
Parameters
value
intThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(int, Span<char>, char, out bool)
Converts an integer into a Span<T> of characters, without a negative sign.
public static int ConvertToText(this int value, Span<char> result, char digitGroupSeparator, out bool valueIsNegative)
Parameters
value
intThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
valueIsNegative
boolThe value will be true if the
value
is a negative number.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(long, Span<char>)
Converts a long integer into a Span<T> of characters.
public static int ConvertToText(this long value, Span<char> result)
Parameters
value
longThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(long, Span<char>, out bool)
Converts a long integer into a Span<T> of characters, without a negative sign.
public static int ConvertToText(this long value, Span<char> result, out bool valueIsNegative)
Parameters
value
longThe number to convert.
result
Span<char>The target to contain the result of the conversion.
valueIsNegative
boolThe value will be true if the
value
is a negative number.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(long, Span<char>, char)
Converts a long integer into a Span<T> of characters.
public static int ConvertToText(this long value, Span<char> result, char digitGroupSeparator)
Parameters
value
longThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(long, Span<char>, char, out bool)
Converts a long integer into a Span<T> of characters, without a negative sign.
public static int ConvertToText(this long value, Span<char> result, char digitGroupSeparator, out bool valueIsNegative)
Parameters
value
longThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
valueIsNegative
boolThe value will be true if the
value
is a negative number.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(sbyte, Span<char>)
Converts a signed byte into a Span<T> of characters.
public static int ConvertToText(this sbyte value, Span<char> result)
Parameters
value
sbyteThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(ushort, Span<char>)
Converts an unsigned short integer into a Span<T> of characters.
public static int ConvertToText(this ushort value, Span<char> result)
Parameters
value
ushortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(ushort, Span<char>, char)
Converts an unsigned short integer into a Span<T> of characters.
public static int ConvertToText(this ushort value, Span<char> result, char digitGroupSeparator)
Parameters
value
ushortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(uint, Span<char>)
Converts an unsigned integer into a Span<T> of characters.
public static int ConvertToText(this uint value, Span<char> result)
Parameters
value
uintThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(uint, Span<char>, char)
Converts an unsigned integer into a Span<T> of characters.
public static int ConvertToText(this uint value, Span<char> result, char digitGroupSeparator)
Parameters
value
uintThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(ulong, Span<char>)
Converts an unsigned long integer into a Span<T> of characters.
public static int ConvertToText(this ulong value, Span<char> result)
Parameters
value
ulongThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToText(ulong, Span<char>, char)
Converts an unsigned long integer into a Span<T> of characters.
public static int ConvertToText(this ulong value, Span<char> result, char digitGroupSeparator)
Parameters
value
ulongThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(byte, Span<char>)
Converts a byte into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this byte value, Span<char> result)
Parameters
value
byteThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(short, Span<char>)
Converts a short integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this short value, Span<char> result)
Parameters
value
shortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(short, Span<char>, char)
Converts a short integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this short value, Span<char> result, char digitGroupSeparator)
Parameters
value
shortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(int, Span<char>)
Converts an integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this int value, Span<char> result)
Parameters
value
intThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(int, Span<char>, char)
Converts an integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this int value, Span<char> result, char digitGroupSeparator)
Parameters
value
intThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(long, Span<char>)
Converts a long integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this long value, Span<char> result)
Parameters
value
longThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(long, Span<char>, char)
Converts a long integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this long value, Span<char> result, char digitGroupSeparator)
Parameters
value
longThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(sbyte, Span<char>)
Converts a signed byte into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this sbyte value, Span<char> result)
Parameters
value
sbyteThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(ushort, Span<char>)
Converts an unsigned short integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this ushort value, Span<char> result)
Parameters
value
ushortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(ushort, Span<char>, char)
Converts an unsigned short integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this ushort value, Span<char> result, char digitGroupSeparator)
Parameters
value
ushortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(uint, Span<char>)
Converts an unsigned integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this uint value, Span<char> result)
Parameters
value
uintThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(uint, Span<char>, char)
Converts an unsigned integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this uint value, Span<char> result, char digitGroupSeparator)
Parameters
value
uintThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(ulong, Span<char>)
Converts an unsigned long integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this ulong value, Span<char> result)
Parameters
value
ulongThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary(ulong, Span<char>, char)
Converts an unsigned long integer into a Span<T> of characters as a binary value.
public static int ConvertToTextAsBinary(this ulong value, Span<char> result, char digitGroupSeparator)
Parameters
value
ulongThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsBinary<T>(byte, T, ReadOnlySpanAction<char, T>)
Converts a byte into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this byte value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
byteThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(short, T, ReadOnlySpanAction<char, T>)
Converts a short integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this short value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
shortThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(short, T, ReadOnlySpanAction<char, T>, char)
Converts a short integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this short value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
shortThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(int, T, ReadOnlySpanAction<char, T>)
Converts an integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this int value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
intThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(int, T, ReadOnlySpanAction<char, T>, char)
Converts an integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this int value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
intThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(long, T, ReadOnlySpanAction<char, T>)
Converts a long integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this long value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
longThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(long, T, ReadOnlySpanAction<char, T>, char)
Converts a long integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this long value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
longThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(sbyte, T, ReadOnlySpanAction<char, T>)
Converts a signed byte into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this sbyte value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
sbyteThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(ushort, T, ReadOnlySpanAction<char, T>)
Converts an unsigned short integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this ushort value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
ushortThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(ushort, T, ReadOnlySpanAction<char, T>, char)
Converts an unsigned short integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this ushort value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
ushortThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(uint, T, ReadOnlySpanAction<char, T>)
Converts an unsigned integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this uint value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
uintThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(uint, T, ReadOnlySpanAction<char, T>, char)
Converts an unsigned integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this uint value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
uintThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(ulong, T, ReadOnlySpanAction<char, T>)
Converts an unsigned long integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this ulong value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
ulongThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsBinary<T>(ulong, T, ReadOnlySpanAction<char, T>, char)
Converts an unsigned long integer into a ReadOnlySpan<T> of characters as a binary value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsBinary<T>(this ulong value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
ulongThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex(byte, Span<char>)
Converts a byte into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this byte value, Span<char> result)
Parameters
value
byteThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(short, Span<char>)
Converts a short integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this short value, Span<char> result)
Parameters
value
shortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
ConvertToTextAsHex(short, Span<char>, char)
Converts a short integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this short value, Span<char> result, char digitGroupSeparator)
Parameters
value
shortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(int, Span<char>)
Converts an integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this int value, Span<char> result)
Parameters
value
intThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(int, Span<char>, char)
Converts an integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this int value, Span<char> result, char digitGroupSeparator)
Parameters
value
intThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(long, Span<char>)
Converts a long integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this long value, Span<char> result)
Parameters
value
longThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(long, Span<char>, char)
Converts a long integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this long value, Span<char> result, char digitGroupSeparator)
Parameters
value
longThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(sbyte, Span<char>)
Converts a signed byte into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this sbyte value, Span<char> result)
Parameters
value
sbyteThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(ushort, Span<char>)
Converts an unsigned short integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this ushort value, Span<char> result)
Parameters
value
ushortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(ushort, Span<char>, char)
Converts an unsigned short integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this ushort value, Span<char> result, char digitGroupSeparator)
Parameters
value
ushortThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(uint, Span<char>)
Converts an unsigned integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this uint value, Span<char> result)
Parameters
value
uintThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(uint, Span<char>, char)
Converts an unsigned integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this uint value, Span<char> result, char digitGroupSeparator)
Parameters
value
uintThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(ulong, Span<char>)
Converts an unsigned long integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this ulong value, Span<char> result)
Parameters
value
ulongThe number to convert.
result
Span<char>The target to contain the result of the conversion.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex(ulong, Span<char>, char)
Converts an unsigned long integer into a Span<T> of characters as a hexadecimal value.
public static int ConvertToTextAsHex(this ulong value, Span<char> result, char digitGroupSeparator)
Parameters
value
ulongThe number to convert.
result
Span<char>The target to contain the result of the conversion.
digitGroupSeparator
charThe character to use for separating groups of digits.
Returns
- int
Returns the number of characters in the result.
Exceptions
- IndexOutOfRangeException
Thrown if
result
is not long enough to hold the value.
ConvertToTextAsHex<T>(byte, T, ReadOnlySpanAction<char, T>)
Converts a byte into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this byte value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
byteThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(short, T, ReadOnlySpanAction<char, T>)
Converts a short integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this short value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
shortThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(short, T, ReadOnlySpanAction<char, T>, char)
Converts a short integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this short value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
shortThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(int, T, ReadOnlySpanAction<char, T>)
Converts an integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this int value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
intThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(int, T, ReadOnlySpanAction<char, T>, char)
Converts an integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this int value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
intThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(long, T, ReadOnlySpanAction<char, T>)
Converts a long integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this long value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
longThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(long, T, ReadOnlySpanAction<char, T>, char)
Converts a long integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this long value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
longThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(sbyte, T, ReadOnlySpanAction<char, T>)
Converts a signed byte into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this sbyte value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
sbyteThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(ushort, T, ReadOnlySpanAction<char, T>)
Converts an unsigned short integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this ushort value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
ushortThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(ushort, T, ReadOnlySpanAction<char, T>, char)
Converts an unsigned short integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this ushort value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
ushortThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(uint, T, ReadOnlySpanAction<char, T>)
Converts an unsigned integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this uint value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
uintThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(uint, T, ReadOnlySpanAction<char, T>, char)
Converts an unsigned integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this uint value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
uintThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(ulong, T, ReadOnlySpanAction<char, T>)
Converts an unsigned long integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this ulong value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
ulongThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToTextAsHex<T>(ulong, T, ReadOnlySpanAction<char, T>, char)
Converts an unsigned long integer into a ReadOnlySpan<T> of characters as a hexadecimal value,
then passes that and the argument
into the action
.
public static void ConvertToTextAsHex<T>(this ulong value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
ulongThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToText<T>(long, T, ReadOnlySpanAction<char, T>)
Converts a long integer into a ReadOnlySpan<T> of characters,
then passes that and the argument
into the action
.
public static void ConvertToText<T>(this long value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
longThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToText<T>(long, T, ReadOnlySpanAction<char, T>, char)
Converts a long integer into a ReadOnlySpan<T> of characters,
then passes that and the argument
into the action
.
public static void ConvertToText<T>(this long value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
longThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToText<T>(uint, T, ReadOnlySpanAction<char, T>)
Converts an unsigned integer into a ReadOnlySpan<T> of characters,
then passes that and the argument
into the action
.
public static void ConvertToText<T>(this uint value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
uintThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToText<T>(uint, T, ReadOnlySpanAction<char, T>, char)
Converts an unsigned integer into a ReadOnlySpan<T> of characters,
then passes that and the argument
into the action
.
public static void ConvertToText<T>(this uint value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
uintThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToText<T>(ulong, T, ReadOnlySpanAction<char, T>)
Converts an unsigned long integer into a ReadOnlySpan<T> of characters,
then passes that and the argument
into the action
.
public static void ConvertToText<T>(this ulong value, T argument, ReadOnlySpanAction<char, T> action)
Parameters
value
ulongThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.
ConvertToText<T>(ulong, T, ReadOnlySpanAction<char, T>, char)
Converts an unsigned long integer into a ReadOnlySpan<T> of characters,
then passes that and the argument
into the action
.
public static void ConvertToText<T>(this ulong value, T argument, ReadOnlySpanAction<char, T> action, char digitGroupSeparator)
Parameters
value
ulongThe number to convert.
argument
TThe argument to pass into the
action
.action
ReadOnlySpanAction<char, T>The action to perform with the resulting ReadOnlySpan<T> of characters.
digitGroupSeparator
charThe character to use for separating groups of digits.
Type Parameters
T
The type of
argument
to pass into theaction
.
Exceptions
- ArgumentNullException
Thrown if the
action
is null.