Trim the sequence removing the last 'n' characters

@param n - Number of characters to remove
481745
public void rTrim(int n) {
        super.rTrim(n);
        this.setQuality(this.quality.substring(0, this.quality.length() - n));
    }
548063
public void removeCharCommand()
    {
        if (!isCharCommand())
            return;
        if (getValue() == null)
            return;
        if (getValue().length() < 2)
            return;
        if (getValue().length() == 2)
        {
            setValue(null);
            setUsed(true);
            return;
        }
        setValue("-" + getValue().substring(2));
    }
184037
public static String cleanSequence(String sequence) {
	assert sequence != null;
	final Matcher m = SequenceUtil.WHITE_SPACE.matcher(sequence);
	sequence = m.replaceAll("").toUpperCase();
	return sequence;
	}
1189854
public void trimToSize(int maxSize) {
        while (true) {
            K key;
            V value;
            synchronized (this) {
                if (size < 0 || map.isEmpty() && size != 0) {
                    throw new IllegalStateException(getClass().getName() + ".sizeOf() is reporting inconsistent results!");
                }

                if (size <= maxSize || map.isEmpty()) {
                    break;
                }

                Map.Entry<K, V> toEvict = map.entrySet().iterator().next();
                key = toEvict.getKey();
                value = toEvict.getValue();
                map.remove(key);
                size -= safeSizeOf(key, value);
                evictionCount++;
            }

            entryRemoved(true, key, value, null);
        }
    }
251659
public void removeAttribute(String n)
    {
        attributes.remove(n);
        if (n.endsWith(".*"))
            prefixes.remove(n.substring(0,n.length()-2));
    }
966768
public void reset( int N ) {
        this.N = N;

        this.diag = null;
        this.off = null;

        if( splits.length < N ) {
            splits = new int[N];
        }

        numSplits = 0;

        x1 = 0;
        x2 = N-1;

        steps = numExceptional = lastExceptional = 0;

        this.Q = null;
    }
419975
private ByteBuffer removeChar(Sequence sequenceObj)
	{

		byte[] sequenceByte = sequenceObj.getSequenceByte();
		int beginPosition = 0;
		int endPosition = (int) sequenceObj.getLength();
		if (sequenceByte[0] == 'n')
		{
			for (byte base : sequenceByte)
			{
				if ('n' == (char) base)
				{
					beginPosition++;
					beginDelSequenceStr+=(char)base;
				}
				else
				{
					break;
				}
			}
			
			if (beginPosition == endPosition)
			{
				return ByteBuffer.wrap(new byte[0]);
			}
		}
		if (sequenceByte[endPosition - 1] == 'n')
		{

			for (int i = endPosition - 1; i > 0; i--)
			{
				if ('n' == sequenceByte[i])
				{
					endPosition--;
				}
				else
				{
					break;
				}
			}
		}

		int length = (int) (endPosition - beginPosition);
		int offset = beginPosition;
		byte[] strippedSequence = new byte[length];
		System.arraycopy(sequenceObj.getSequenceByte(), offset, strippedSequence, 0, length);
		return ByteBuffer.wrap(strippedSequence, 0, strippedSequence.length);

	}
1054525
public static String[] trim(String[] array) {
	int from = 0;
	int to = 0;

	// test start
	for (int i = 0; i < array.length; i++) {
	    from = i;
	    if (array[i].length() != 0) break;
	}

	// test end
	for (int i = array.length - 1; i >= 0; i--) {
	    to = i;
	    if (array[i].length() != 0) break;
	}

	int newLen = to - from + 1;

	if (newLen < array.length) {
	    String[] rtn = new String[newLen];
	    System.arraycopy(array, from, rtn, 0, newLen);
	    return rtn;
	}
	return array;
    }
1282685
private void cleanContentLeadingSpaces()
    {
        if (getContent().length() > 0) {
            if (fPreviousInlineText.length() == 0
                || fPreviousInlineText
                .charAt(fPreviousInlineText.length() - 1) == ' ')
            {
                trimLeadingWhiteSpaces();
            }
        }
    }
966914
public StrBuilder trim() {
        if (size == 0) {
            return this;
        }
        int len = size;
        final char[] buf = buffer;
        int pos = 0;
        while (pos < len && buf[pos] <= ' ') {
            pos++;
        }
        while (pos < len && buf[len - 1] <= ' ') {
            len--;
        }
        if (len < size) {
            delete(len, size);
        }
        if (pos > 0) {
            delete(0, pos);
        }
        return this;
    }
1309439
public static String last(final String value, int n) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        if (n > value.length()) {
            return value;
        }
        return value.substring(value.length() - n);
    }
340836
private void trimZeros()
  {
    // loop over ALL_ZEROS_LITERAL words
    int w;
    do {
      w = words[lastWordIndex];
      if (w == ConciseSetUtils.ALL_ZEROS_LITERAL) {
        lastWordIndex--;
      } else if (isZeroSequence(w)) {
        if (simulateWAH || isSequenceWithNoBits(w)) {
          lastWordIndex--;
        } else {
          // convert the sequence in a 1-bit literal word
          words[lastWordIndex] = getLiteral(w);
          return;
        }
      } else {
        // one sequence or literal
        return;
      }
      if (lastWordIndex < 0) {
        reset();
        return;
      }
    } while (true);
  }
553227
public static String trim(String s, int maxWidth) {
    if (s.length() <= maxWidth) {
      return (s);
    }
    return (s.substring(0, maxWidth));
  }
1347151
public static String trim(String string)
  {
    if(string == null) {
      return null;
    }
    int length = string.length();
    int beginIndex = 0;
    for(; beginIndex < length; ++beginIndex) {
      if(!Character.isWhitespace(string.charAt(beginIndex))) break;
    }
    int endIndex = length - 1;
    for(; endIndex >= 0; --endIndex) {
      if(!Character.isWhitespace(string.charAt(endIndex))) break;
    }
    return string.substring(beginIndex, endIndex + 1);
  }
732307
public char skip(int n)
  {
    _pos += n;
    
    if (_length <= _pos) {
      _pos = _string.length();
      return DONE;
    } else
      return _string.charAt(_pos);
  }
1089887
public static String 
    trimLeft( String string ) 
    {
    	for( int i = 0; i < string.length(); ++i ) 
    	{
    		char charAt = string.charAt( i );
            if( charAt != ' '  
    		 && charAt != '\t' 
    		 && charAt != '\n'
    		 && charAt != '\r' ) 
    		{    			
    			return i == 0 ? string : 
    			                string.substring( i );
    		}
    	}
    	return string;
    }
611366
public void removeRange(int first, int last) {
        int ele;

        for (ele = first; ele <= last; ele++) {
            remove(ele);
        }
    }