Pass string interpolation.

This commit is contained in:
2023-10-04 08:16:20 +01:00
parent 6f76a5d460
commit bfe4402f0a
2 changed files with 3 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ public static partial class ArrayHelpers
var sb = new StringBuilder(); var sb = new StringBuilder();
for(long i = 0; i < array.LongLength; i++) for(long i = 0; i < array.LongLength; i++)
sb.AppendFormat("{0:x2}", array[i]); sb.Append($"{array[i]:x2}");
return upper ? sb.ToString().ToUpper() : sb.ToString(); return upper ? sb.ToString().ToUpper() : sb.ToString();
} }

View File

@@ -87,7 +87,7 @@ public static class PrintHex
sb.Append(" "); sb.Append(" ");
for(var i = 0; i < width; i++) for(var i = 0; i < width; i++)
sb.AppendFormat(" {0:X2}", i); sb.Append($" {i:X2}");
if(color) if(color)
sb.Append("\u001b[0m"); sb.Append("\u001b[0m");
@@ -114,7 +114,7 @@ public static class PrintHex
for(var j = 0; j < lastBytes; j++) for(var j = 0; j < lastBytes; j++)
{ {
sb.AppendFormat(" {0:X2}", array[b]); sb.Append($" {array[b]:X2}");
b++; b++;
} }