B2026 053 find unlinked values of selected #795

Merged
mschill merged 28 commits from B2026-053-Find-Unlinked-Values-of-Selected into Development 2026-07-30 15:29:20 -04:00
Showing only changes of commit 2261c8f0f5 - Show all commits
+17 -3
View File
10
@@ -2199,7 +2199,7 @@ namespace Volian.Controls.Library
if (match.Success) // Special case for percents. if (match.Success) // Special case for percents.
{ {
int sl = SearchString.Length; int sl = SearchString.Length;
int precentIdx = SearchString.IndexOf('%'); int precentIdx = SearchString.LastIndexOf('%');
mschill marked this conversation as resolved Outdated
Outdated
Review

What if multiple % signs? - like search for:
3% or 4% --- I believe the matches returned by the Regex object will give position of what is found.

What if multiple % signs? - like search for: 3% or 4% --- I believe the matches returned by the Regex object will give position of what is found.
int startIndex = 0; int startIndex = 0;
if (sl == precentIdx + 1) // % the last char. if (sl == precentIdx + 1) // % the last char.
{ {
@@ -2207,12 +2207,26 @@ namespace Volian.Controls.Library
var isNumeric = int.TryParse(ss, out int n); var isNumeric = int.TryParse(ss, out int n);
if (isNumeric == true) // B2026-053 other that a % are the rest of the characters numbers. if (isNumeric == true) // B2026-053 other that a % are the rest of the characters numbers.
mschill marked this conversation as resolved Outdated
Outdated
Review

With working on tech debt project --- moving forward need to follow suggested code practices / suggestions by SonarLint --- if (isNumeric == true) should be
if (isNumeric)

With working on tech debt project --- moving forward need to follow suggested code practices / suggestions by SonarLint --- if (isNumeric == true) should be if (isNumeric)
{ {
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.
mschill marked this conversation as resolved Outdated
Outdated
Review

With working on technical debt - should avoid concatenating strings & use string interpolation instead.

With working on technical debt - should avoid concatenating strings & use string interpolation instead.
}
else
{
ss = ' ' + SearchString + ' '; // string it not a percent.
mschill marked this conversation as resolved Outdated
Outdated
Review

With working on technical debt - should avoid concatenating strings & use string interpolation instead.

With working on technical debt - should avoid concatenating strings & use string interpolation instead.
} }
} }
else 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.;
mschill marked this conversation as resolved Outdated
Outdated
Review

With working on technical debt - should avoid concatenating strings & use string interpolation instead.

With working on technical debt - should avoid concatenating strings & use string interpolation instead.
}
else
{
ss = ' ' + SearchString + ' '; // Exact match add spaces before and after search string.
mschill marked this conversation as resolved Outdated
Outdated
Review

With working on technical debt - should avoid concatenating strings & use string interpolation instead.

With working on technical debt - should avoid concatenating strings & use string interpolation instead.
}
} }
} }
else else
1