public static MyString operator --(MyString s) { MyString ret = new MyString(s); ret.data = ret.data.Remove((ret.ToString().Length - 1), 1); return(ret); }
public static bool ServiceCheck(this MyString str) { HashSet <char> serviceSymbols = new HashSet <char>(); serviceSymbols.Add('/'); serviceSymbols.Add('\\'); serviceSymbols.Add('"'); serviceSymbols.Add('$'); foreach (var i in str.ToString()) { if (serviceSymbols.Contains(i)) { return(true); } } return(false); }
public static MyString DeletePunctuation(this MyString str) { MyString temp = new MyString(str); HashSet <char> serviceSymbols = new HashSet <char>(); serviceSymbols.Add('.'); serviceSymbols.Add(','); serviceSymbols.Add(':'); serviceSymbols.Add('?'); serviceSymbols.Add('!'); serviceSymbols.Add('-'); string tempString = str.ToString(); for (int i = 0; i < tempString.Length; i++) { if (serviceSymbols.Contains(tempString[i])) { tempString = tempString.Remove(i, 1); } } temp.SetString(tempString); return(temp); }
public static int Count(this MyString str) { return(str.ToString().Length); }