Skip to content

Commit

Permalink
Merge pull request #88453 from Repiteo/dotnet/stringextensions-match-…
Browse files Browse the repository at this point in the history
…core

C#: Match Core implementation of `BinToInt` & `HexToInt`
  • Loading branch information
akien-mga committed Feb 17, 2024
2 parents 9ae8a0e + 48428bd commit 59f9666
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static int BinToInt(this string instance)
instance = instance.Substring(1);
}

if (instance.StartsWith("0b"))
if (instance.StartsWith("0b", StringComparison.OrdinalIgnoreCase))
{
instance = instance.Substring(2);
}
Expand Down Expand Up @@ -816,7 +816,7 @@ public static int HexToInt(this string instance)
instance = instance.Substring(1);
}

if (instance.StartsWith("0x"))
if (instance.StartsWith("0x", StringComparison.OrdinalIgnoreCase))
{
instance = instance.Substring(2);
}
Expand Down

0 comments on commit 59f9666

Please sign in to comment.