diff --git a/GitHubActionsTestLogger/Utils/Extensions/StringExtensions.cs b/GitHubActionsTestLogger/Utils/Extensions/StringExtensions.cs index 2cf65a9..c999dbf 100644 --- a/GitHubActionsTestLogger/Utils/Extensions/StringExtensions.cs +++ b/GitHubActionsTestLogger/Utils/Extensions/StringExtensions.cs @@ -31,9 +31,7 @@ public string SubstringAfterLast( ) { var index = str.LastIndexOf(sub, comparison); - return index >= 0 - ? str.Substring(index + sub.Length, str.Length - index - sub.Length) - : ""; + return index < 0 ? "" : str[(index + sub.Length)..]; } }