Last active
July 26, 2019 00:55
-
-
Save thebitbrine/bcee086f59431ec5790ec989596d8db0 to your computer and use it in GitHub Desktop.
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 string CleanText(string Input) | |
{ | |
string res = Input.Replace("\r", "").Replace("\n", "").Replace("\t", "").Replace("\b", ""); | |
if (res.StartsWith(' ')) | |
res = res.Remove(0, 1); | |
if (res.EndsWith(' ')) | |
res = res.Remove(res.Length - 1, 1); | |
while (res.Contains(" ")) | |
res = res.Replace(" ", " "); | |
return res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment