From 2261c8f0f5522a48c8f091414e85b510deb7d17e Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Fri, 24 Jul 2026 10:47:25 -0400 Subject: [PATCH] B2026-053-Find-Unlinked-Values-of-Selected --- .../Volian.Controls.Library/DisplaySearch.cs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplaySearch.cs b/PROMS/Volian.Controls.Library/DisplaySearch.cs index d0361ac5..c981bfb9 100644 --- a/PROMS/Volian.Controls.Library/DisplaySearch.cs +++ b/PROMS/Volian.Controls.Library/DisplaySearch.cs @@ -2199,7 +2199,7 @@ namespace Volian.Controls.Library if (match.Success) // Special case for percents. { int sl = SearchString.Length; - int precentIdx = SearchString.IndexOf('%'); + int precentIdx = SearchString.LastIndexOf('%'); int startIndex = 0; if (sl == precentIdx + 1) // % the last char. { @@ -2207,12 +2207,26 @@ namespace Volian.Controls.Library var isNumeric = int.TryParse(ss, out int n); if (isNumeric == true) // B2026-053 other that a % are the rest of the characters numbers. { - ss = ' ' + SearchString; //B2026-053 add a space prefix to make the search exact. If search is 5% this makes it excult 25% 55% etc.; + ss = ' ' + SearchString + ' '; // to get exact match add spaces before and after search string. + } + else + { + ss = ' ' + SearchString + ' '; // string it not a percent. } } else { - ss = ' ' + SearchString + ' '; // Exact match add spaces before and after search string. + int strl2 = SearchString.Length; + int prcIdx2 = SearchString.LastIndexOf(' '); + int strIdx2 = 0; + if (strl2 == prcIdx2 + 1) // if the last char is ' ' the last char. + { + ss = ' ' + SearchString; //B2026-053 add a space prefix to make the search exact. If search is 5% this makes it excult 25% 55% etc.; + } + else + { + ss = ' ' + SearchString + ' '; // Exact match add spaces before and after search string. + } } } else