Skip to content

Commit 062d1cc

Browse files
CopilotTyrrrz
andauthored
Use range indexer in SubstringAfter (#941)
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 31cefef commit 062d1cc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

YoutubeExplode/Utils/Extensions/StringExtensions.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ public string SubstringAfter(
2525
)
2626
{
2727
var index = str.IndexOf(sub, comparison);
28-
29-
return index < 0
30-
? string.Empty
31-
: str.Substring(index + sub.Length, str.Length - index - sub.Length);
28+
return index < 0 ? string.Empty : str[(index + sub.Length)..];
3229
}
3330

3431
public string StripNonDigit()

0 commit comments

Comments
 (0)