Skip to content

Commit 7a5fc7e

Browse files
committed
Update
1 parent e51a3f0 commit 7a5fc7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Algorithms/Other/Luhn.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public static class Luhn
2828
/// <returns>Missing digit.</returns>
2929
public static int GetLostNum(string number)
3030
{
31-
var missingDigitIndex = number.Length - 1 - number.LastIndexOf('x');
32-
var checkDigit = GetSum(number.Replace("x", "0")) * 9 % 10;
31+
var missingDigitIndex = number.Length - 1 - number.LastIndexOf("x", StringComparison.CurrentCultureIgnoreCase);
32+
var checkDigit = GetSum(number.Replace("x", "0", StringComparison.CurrentCultureIgnoreCase)) * 9 % 10;
3333

3434
return missingDigitIndex % 2 == 0
3535
? checkDigit

0 commit comments

Comments
 (0)