Skip to content

Instantly share code, notes, and snippets.

@DynamicField
Created January 23, 2018 19:28
Show Gist options
  • Save DynamicField/f0527eb0c0fd9d47c0e327d3258bc6ff to your computer and use it in GitHub Desktop.
Save DynamicField/f0527eb0c0fd9d47c0e327d3258bc6ff to your computer and use it in GitHub Desktop.
Makes your string gO cRaZy Af
public static class Extensions {
public static string ToDrunk(this string str,byte start = 0) {
string pre = "";
byte space = start;
foreach (var character in str) {
if (space >= 1) {
pre += char.ToUpper(character);
if (char.IsLetter(character))
space = 0;
}
else {
pre += char.ToLower(character);
if (char.IsLetter(character))
space++;
}
}
return pre;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment