public void StrSwap(ref String str, int a, int b, int m) { for (int i = 0; i < m; i++) { if (b + i >= str.Length) break; Char tmp = str[a + i]; this.ReplaceCharInString(ref str, a + i, str[b + i]); this.ReplaceCharInString(ref str, b + i, tmp); }}