Created
January 23, 2018 19:28
-
-
Save DynamicField/f0527eb0c0fd9d47c0e327d3258bc6ff to your computer and use it in GitHub Desktop.
Makes your string gO cRaZy Af
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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