@Test public void testUnpadAllPadding() throws Exception { assertEquals("", padder.unpad("000")); }
public String unpad(String paddedData) { int len = paddedData.length(); for (int i = len; i > 0; i--) { if (paddedData.charAt(i - 1) != pad) { return paddedData.substring(0, i); } } return ""; }
RightPadder implements Padder { public String unpad(String paddedData) { int len = paddedData.length(); for (int i = len; i > 0; i--) { if (paddedData.charAt(i - 1) != pad) { return paddedData.substring(0, i); } } return ""; } }
RightPadder implements Padder { public String unpad(String paddedData) { int len = paddedData.length(); for (int i = len; i > 0; i--) { if (paddedData.charAt(i - 1) != pad) { return paddedData.substring(0, i); } } return ""; } RightPadder(char pad); }
RightPadder implements Padder { public String unpad(String paddedData) { int len = paddedData.length(); for (int i = len; i > 0; i--) { if (paddedData.charAt(i - 1) != pad) { return paddedData.substring(0, i); } } return ""; } RightPadder(char pad); String pad(String data, int maxLength); String unpad(String paddedData); }
RightPadder implements Padder { public String unpad(String paddedData) { int len = paddedData.length(); for (int i = len; i > 0; i--) { if (paddedData.charAt(i - 1) != pad) { return paddedData.substring(0, i); } } return ""; } RightPadder(char pad); String pad(String data, int maxLength); String unpad(String paddedData); static final RightPadder SPACE_PADDER; }