Skip to content

Instantly share code, notes, and snippets.

@NattyNarwhal
Created April 25, 2016 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NattyNarwhal/16cb31e7ab6dc16a145c661292f7be18 to your computer and use it in GitHub Desktop.
Save NattyNarwhal/16cb31e7ab6dc16a145c661292f7be18 to your computer and use it in GitHub Desktop.
public static string TranslateString(this string original, Dictionary<char, char> mapping)
{
return new string(original.Select(c => mapping.ContainsKey(c) ? mapping[c] : c).ToArray());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment