Anonymous user
Validate International Securities Identification Number: Difference between revisions
Validate International Securities Identification Number (view source)
Revision as of 15:58, 25 February 2020
, 4 years agoMinor tweaks to 'Summand' + code formatting
(Update to *modern* C#) |
m (Minor tweaks to 'Summand' + code formatting) |
||
Line 544:
using System.Text.RegularExpressions;
namespace
{
public static class IsinValidator
Line 561:
private static int Summand(int digit, int i) =>
digit + (i % 2) * (digit - (digit >=
? digit▼
private static int DigitValue(char c) =>
Line 575 ⟶ 571:
public class Program
{
public static void Main(
{
string[] isins =
"US0378331005",
"US0373831005",
Line 586 ⟶ 583:
"FR0000988040"
};
foreach (string isin in isins) {
Console.WriteLine($"{isin} is {validOrNot}");
}
}
|