private string clr0(string input) { if (input[input.Length - 1] == '\0') return input.Substring(0, input.Length - 1); else return input; }