Skip to content

Commit

Permalink
Update link. (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengweiqhca authored Jan 3, 2025
1 parent aa85884 commit 8892c07
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Polyfill/Polyfill_String.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static bool Contains(this string target, string value, StringComparison c
/// <param name="value">The character to compare.</param>
/// <remarks>This method performs an ordinal (case-sensitive and culture-insensitive) comparison.</remarks>
/// <returns>true if value matches the beginning of this string; otherwise, false.</returns>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.string.contains#system-string-contains(system-char)
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.string.startswith#system-string-startswith(system-char)
public static bool StartsWith(this string target, char value)
{
if (target.Length == 0)
Expand All @@ -84,7 +84,7 @@ public static bool StartsWith(this string target, char value)
/// <param name="value">The character to seek.</param>
/// <remarks>This method performs an ordinal (case-sensitive and culture-insensitive) comparison.</remarks>
/// <returns>true if the value parameter occurs within this string; otherwise, false.</returns>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.string.contains#system-string-contains(system-char)
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.string.endswith#system-string-endswith(system-char)
public static bool EndsWith(this string target, char value)
{
if (target.Length == 0)
Expand All @@ -93,8 +93,7 @@ public static bool EndsWith(this string target, char value)
}

var lastPos = target.Length - 1;
return lastPos < target.Length &&
target[lastPos] == value;
return target[lastPos] == value;
}

/// <summary>
Expand Down

0 comments on commit 8892c07

Please sign in to comment.