Skip to content

Instantly share code, notes, and snippets.

@bolenton
Created May 19, 2016 05:44
Show Gist options
  • Save bolenton/0ab5cd1053824907e3c9452493c614bc to your computer and use it in GitHub Desktop.
Save bolenton/0ab5cd1053824907e3c9452493c614bc to your computer and use it in GitHub Desktop.
public static string ShorterReverseLonger(string a, string b)
{
if(a == null)a = "" ;
if (b == null) b = "";
return (a.Length > b.Length || a.Length == b.Length) ? b + new string(a.ToCharArray().Reverse().ToArray()) + b : a + b.Reverse() + a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment