diff --git a/src/modules/launcher/PowerLauncher/ViewModel/MainViewModel.cs b/src/modules/launcher/PowerLauncher/ViewModel/MainViewModel.cs index d9ecdd45da..f8eff3f4d0 100644 --- a/src/modules/launcher/PowerLauncher/ViewModel/MainViewModel.cs +++ b/src/modules/launcher/PowerLauncher/ViewModel/MainViewModel.cs @@ -1075,7 +1075,7 @@ namespace PowerLauncher.ViewModel else { // Using Ordinal this is internal - return string.IsNullOrEmpty(queryText) || autoCompleteText.IndexOf(queryText, StringComparison.Ordinal) != 0; + return string.IsNullOrEmpty(queryText) || !autoCompleteText.StartsWith(queryText, StringComparison.Ordinal); } } @@ -1086,7 +1086,7 @@ namespace PowerLauncher.ViewModel if (index == 0) { // Using OrdinalIgnoreCase because we want the characters to be exact in autocomplete text and the query - if (input.IndexOf(query, StringComparison.OrdinalIgnoreCase) == 0) + if (input.StartsWith(query, StringComparison.OrdinalIgnoreCase)) { // Use the same case as the input query for the matched portion of the string return string.Concat(query, input.AsSpan(query.Length)); @@ -1104,7 +1104,7 @@ namespace PowerLauncher.ViewModel if (index == 0 && !string.IsNullOrEmpty(query)) { // Using OrdinalIgnoreCase since this is internal - if (input.IndexOf(query, StringComparison.OrdinalIgnoreCase) == 0) + if (input.StartsWith(query, StringComparison.OrdinalIgnoreCase)) { return string.Concat(query, input.AsSpan(query.Length)); }