private string shift(string str, int offset) { if (str == null) { throw new ArgumentNullException(); } StringBuilder res = new StringBuilder(); foreach (char ch in str) { if (!Abc.Contains(ch) || char.IsControl(ch)) { throw new ArgumentOutOfRangeException(); } else { res.Append(shift(ch, offset)); } } return(res.ToString()); }