Java Utililty Methods String Unpad

List of utility methods to do String Unpad

Description

The list of methods to do String Unpad are organized into topic(s).

Method

byte[]unPad(byte[] bytes)
un Pad
int padded = (int) bytes[bytes.length - 1];
int targetLength = bytes.length - padded;
byte[] out = new byte[targetLength];
System.arraycopy(bytes, 0, out, 0, targetLength);
return out;
voidunPad(byte[] src, int start, byte[] dest)
Strip single padding base that Complete Genomics v2 reads contain, if present.
System.arraycopy(src, start, dest, 0, CG2_PAD_POSITION);
System.arraycopy(src, start + CG2_PAD_POSITION + 1, dest, CG2_PAD_POSITION,
        CG2_RAW_READ_LENGTH - CG2_PAD_POSITION);
StringunPadLeft(String s, char c)
Unpad from left.
if ((s.trim().length() == 0) && (c == ' '))
    return (new Character(c)).toString();
else if ((s.trim().length() == 0))
    return s;
s = s.trim();
int fill = 0, end = s.length();
while ((fill < end) && (s.charAt(fill) == c))
    fill++;
...
StringunPadRight(String s, char c)
Unpad from right.
if ((s.trim().length() == 0) && (c == ' '))
    return Character.toString(c);
else if ((s.trim().length() == 0))
    return s;
String sTrim = s.trim();
int end = sTrim.length();
while ((0 < end) && (sTrim.charAt(end - 1) == c))
    end--;
...
StringunpadZeroString(String string)
unpad Zero String
if (string == null) {
    return string;
StringBuffer buf = new StringBuffer(string);
while (buf.charAt(0) == zeroArray[0]) {
    buf = buf.deleteCharAt(0);
return buf.toString();
...