We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e51a3f0 commit 7a5fc7eCopy full SHA for 7a5fc7e
Algorithms/Other/Luhn.cs
@@ -28,8 +28,8 @@ public static class Luhn
28
/// <returns>Missing digit.</returns>
29
public static int GetLostNum(string number)
30
{
31
- var missingDigitIndex = number.Length - 1 - number.LastIndexOf('x');
32
- var checkDigit = GetSum(number.Replace("x", "0")) * 9 % 10;
+ var missingDigitIndex = number.Length - 1 - number.LastIndexOf("x", StringComparison.CurrentCultureIgnoreCase);
+ var checkDigit = GetSum(number.Replace("x", "0", StringComparison.CurrentCultureIgnoreCase)) * 9 % 10;
33
34
return missingDigitIndex % 2 == 0
35
? checkDigit
0 commit comments