You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
695 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helper
{
public static class DivFnkt
{
public static int modulo10(string nummer)
{
// 'nummer' darf nur Ziffern zwischen 0 und 9 enthalten!
int[] tabelle = { 0, 9, 4, 6, 8, 2, 7, 1, 3, 5 };
int uebertrag = 0;
foreach (char ziffer in nummer)
uebertrag = tabelle[(uebertrag + ziffer - '0') % 10];
return (10 - uebertrag) % 10;
}
public static bool IsNumeric(string value)
{
return value.All(char.IsNumber);
}
}
}