Files
EDOKA_2024/Helper/helper.cs
Stefan Hutter 50e9e06829 Initial Comit
2024-05-31 13:32:10 +02:00

31 lines
694 B
C#

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);
}
}
}