2018-04-22 16:45:04 +00:00
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace DeukBot4.Utilities
|
|
|
|
|
{
|
|
|
|
|
public static class StringExtensions
|
|
|
|
|
{
|
|
|
|
|
public static string RemoveSpecialCharacters(this string str) {
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
foreach (char c in str) {
|
2018-04-30 17:14:41 +00:00
|
|
|
|
if (char.IsLetterOrDigit(c) || char.IsWhiteSpace(c)) {
|
2018-04-22 16:45:04 +00:00
|
|
|
|
sb.Append(c);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return sb.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|