using System; using System.Linq; public class Test { public static void Main() { string[] tests = { "a", 1.ToString(), "321", "xyz" }; foreach (var test in tests) { Console.WriteLine(test.ToChar()); } } } public static class StringExtensions { public static char ToChar(this string value) { if (string.IsNullOrEmpty(value)) throw new ArgumentException(); return value.First(); } }