Feedback

Herausfinden, ob ein Character eine Zahl ist.

Sprache: C#

Mit dieser Methode kann geprüft werden, ob die char Instanz eine Zahl enthält. Beispiel: [code] char c = ''5''; bool b = IsNumericChar(c); // b = true [/code]
static bool IsNumericChar(char c)
{
    return ((c >= 47) && (c <= 57));
}
static bool IsNumericChar(char c)
{
    return ((c >= 47) && (c <= 57));
}

4 Kommentare