From 55a0ecf631a59bee0b5b3519f5f5bfff3c569b4f Mon Sep 17 00:00:00 2001 From: haven1433 Date: Mon, 31 Jul 2023 22:07:16 -0500 Subject: [PATCH] fix skip count start counting from the last possible match of the first letter, causes a lower skip count that way --- src/HexManiac.Core/Core/SystemExtensions.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/HexManiac.Core/Core/SystemExtensions.cs b/src/HexManiac.Core/Core/SystemExtensions.cs index 099c7156..b03ec231 100644 --- a/src/HexManiac.Core/Core/SystemExtensions.cs +++ b/src/HexManiac.Core/Core/SystemExtensions.cs @@ -251,6 +251,7 @@ namespace HavenSoft.HexManiac.Core { /// public static int SkipCount(this string full, string partial) { int j = 0, skipCount = 0; + partial = partial.ToUpper(); for (int i = 0; i < partial.Length; i++) { var testPartial = char.ToUpperInvariant(partial[i]); @@ -262,6 +263,7 @@ namespace HavenSoft.HexManiac.Core { if (full[j] == 'รก') testFull = 'A'; j++; if (testFull == testPartial) break; + if (testFull == partial[0] && i == 1) skipCount = 0; if (j == full.Length) return skipCount; if (i > 0) skipCount++; }