public static void Main()
testArg testarg = new testArg(2);
checkIfPalindrome(s , testarg);
Console.WriteLine( testarg.val);
public static void checkIfPalindrome(string s , testArg testarg)
if(s[0] == s[s.Length -1])
checkIfPalindrome(s.Substring(1,s.Length-2) , testarg);
testarg = new testArg(4);
checkIfPalindrome(s.Substring(1,s.Length-1), testarg) ;