public static SequencedString operator +(SequencedString s1, SequencedString s2) { SequencedString newstr = new SequencedString(s1.Length + s2.Length); newstr.Concat(s1); newstr.Concat(s2); return(newstr); }
public SequencedString Remove(int i, int n) { SequencedString sub1, sub2, sub3; sub1 = this.Substring(0, i); sub2 = this.Substring(i, n); sub3 = this.Substring(i + n, this.Length - i - n); SequencedString newstr = new SequencedString(items.Length); newstr.Concat(sub1); newstr.Concat(sub3); return(newstr); }
public SequencedString Insert(int i, char c) { SequencedString sub1, sub2; sub1 = this.Substring(0, i); sub2 = this.Substring(i, this.Length - i); SequencedString newstr = new SequencedString(items.Length + 8); newstr.Concat(sub1); newstr.Concat(c); newstr.Concat(sub2); return(newstr); }
public SequencedString Replace(SequencedString oldsub, SequencedString newsub) { int i, n; SequencedString sub1, sub3; SequencedString newstr = new SequencedString(items.Length + newsub.Length); i = this.IndexOf(oldsub); if (i != -1) { sub1 = this.Substring(0, i); n = oldsub.Length; sub3 = this.Substring(i + n, this.Length - i - n); newstr.Concat(sub1); newstr.Concat(newstr); newstr.Concat(sub3); } return(newstr); }
public SequencedString Reverse() { int i; SequencedString newstr = new SequencedString(items.Length); for (i = this.Length - 1; i >= 0; i--) { newstr.Concat(this.items[i]); } return(newstr); }