Class StringBuilderExtensions
public static class StringBuilderExtensions
- Inheritance
-
StringBuilderExtensions
Methods
AppendByteArrayAsHexViaLookup32(StringBuilder, byte[])
Appends an array of bytes to a StringBuilder in hex (i.e. 255->FF) format utilizing a static lookup table to minimize allocations.
public static StringBuilder AppendByteArrayAsHexViaLookup32(this StringBuilder sb, byte[] bytes)
Parameters
sb
StringBuilderThe StringBuilder to append to
bytes
byte[]The byte array to append in hex
Returns
Remarks
The implementation here was chosen based on: https://stackoverflow.com/a/624379/2937845 Which indicated that https://stackoverflow.com/a/24343727/2937845's implementation of ByteArrayToHexViaLookup32 was the fastest method not involving unsafe
AppendByteAsHexViaLookup32(StringBuilder, byte)
public static StringBuilder AppendByteAsHexViaLookup32(this StringBuilder sb, byte @byte)
Parameters
sb
StringBuilderbyte
byte