private static int GetOctalChar(string str) { if (str.Length != 3) return -1; if (IsOctDigit(str[0]) && IsOctDigit(str[1]) && IsOctDigit(str[2])) return OctChar(str[0], str[1], str[2]); else return -1; }