From bfe4402f0a2d448149fd5d36daf0da5d003e7853 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 4 Oct 2023 08:16:20 +0100 Subject: [PATCH] Pass string interpolation. --- ArrayFill.cs | 2 +- PrintHex.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ArrayFill.cs b/ArrayFill.cs index ac54f41db..ee3e9e1f0 100644 --- a/ArrayFill.cs +++ b/ArrayFill.cs @@ -69,7 +69,7 @@ public static partial class ArrayHelpers var sb = new StringBuilder(); 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(); } diff --git a/PrintHex.cs b/PrintHex.cs index 30934d018..0f3c92b87 100644 --- a/PrintHex.cs +++ b/PrintHex.cs @@ -87,7 +87,7 @@ public static class PrintHex sb.Append(" "); for(var i = 0; i < width; i++) - sb.AppendFormat(" {0:X2}", i); + sb.Append($" {i:X2}"); if(color) sb.Append("\u001b[0m"); @@ -114,7 +114,7 @@ public static class PrintHex for(var j = 0; j < lastBytes; j++) { - sb.AppendFormat(" {0:X2}", array[b]); + sb.Append($" {array[b]:X2}"); b++; }