private void StrReverse(ref String str, int left, int right) { if (left >= right || right >= str.Length) return; for (int i = left, j = right; i < j; i++, j--) { Char tmp = str[i]; this.ReplaceCharInString(ref str, i, str[j]); this.ReplaceCharInString(ref str, j, tmp); } }