java: public int findEndOffset(StringBuilder buffer, int start) {if( start > buffer.length() || start < 0 ) return start;bi.setText(buffer.substring(start));return bi.next() + start;}
C#: public virtual int FindEndOffset(StringBuilder buffer, int start){if (start > buffer.Length || start < 0) return start;bi.SetText(buffer.ToString(start, buffer.Length - start));return bi.Next() + start;}