From 780ce657ca4b14e184c31b99fa9d15dd1108a800 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Mon, 27 Jul 2026 11:28:40 -0400 Subject: [PATCH] B2026-053-Find-Unlinked-Values-of-Selected --- .../Volian.Controls.Library/DisplaySearch.cs | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplaySearch.cs b/PROMS/Volian.Controls.Library/DisplaySearch.cs index e115fa9e..9aec6451 100644 --- a/PROMS/Volian.Controls.Library/DisplaySearch.cs +++ b/PROMS/Volian.Controls.Library/DisplaySearch.cs @@ -2078,7 +2078,7 @@ namespace Volian.Controls.Library if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked) { - string ROSearchList2 = exactsearch(ROSearchList); // match exact string + string ROSearchList2 = exactsearch(ROSearchList); // B2026-053 match exact string // B2022-031 - added a exactsearch to filter out procedure and section titles from global search results. SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList2, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxProcSectSrch.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix, string.Empty, string.Empty); cmbResultsStyleIndex = 3; // display step text in results @@ -2193,23 +2193,14 @@ namespace Volian.Controls.Library private string exactsearch(string SearchString) // B2026-053 { - string ss = ""; - string pattern = "%"; // Pattern to match the percentage sign - Match match = Regex.Match(SearchString, pattern); - if (match.Success) // Special case for percents. + //string ss = ""; + StringBuilder ss = new StringBuilder(); + int sl = SearchString.Length; + int LstIdxSp = SearchString.LastIndexOf(' '); + if (sl == LstIdxSp + 1) // B2026-053 if ' ' the last char. { - int sl = SearchString.Length; - int precentIdx = SearchString.IndexOf('%'); - int startIndex = 0; - if (sl == precentIdx + 1) // % the last char. - { - ss = SearchString.Substring(startIndex, sl - 1); - var isNumeric = int.TryParse(ss, out int n); - if (isNumeric == true) // other that a % are the rest of the characters numbers. - { - ss = ' ' + SearchString; //add a space prefix to make the search exact. If search is 5% this makes it excult 25% 55% etc.; - } - } + ss.Append(' '); + ss.Append(SearchString); // B2026-053 add a space prefix to make the search exact if the end of the searchString is a space. } else {