java: public int findEndOffset(StringBuilder buffer, int start) {if( start > buffer.length() || start < 0 ) return start;int offset, count = maxScan;for( offset = start; offset < buffer.length() && count > 0; count-- ){if( boundaryChars.contains( buffer.charAt( offset ) ) ) return offset;offset++;}return start;}
C#: public virtual int FindEndOffset(StringBuilder buffer, int start){if (start > buffer.Length || start < 0) return start;int offset, count = m_maxScan;for (offset = start; offset < buffer.Length && count > 0; count--){if (m_boundaryChars.Contains(buffer[offset])) return offset;offset++;}return start;}