getting error not all code paths return value by c# compiler
问题 This is a basic string reverse program and I want to do some level of exception handling in it. But during compilation it gives me an error "NOt all code paths return value. I am not able to find out why public static string Reverse(string s) { try { if (string.IsNullOrEmpty(s)) { throw new NullReferenceException(); } char[] c = s.ToCharArray(); int start = 0; int end = c.Length - 1; char temp; while (start < end) { temp = c[start]; c[start] = c[end]; c[end] = temp; start++; end--; } return