public static String removeAllSuffix(CharSequence str, CharSequence suffix) {
		if (isEmpty(str) || isEmpty(suffix)) {
			return str(str);
		}

		final String suffixStr = suffix.toString();
		final int suffixLength = suffixStr.length();

		final String str2 = str.toString();
		int toIndex = str2.length();
		while (str2.startsWith(suffixStr, toIndex - suffixLength)){
			toIndex -= suffixLength;
		}
		return subPre(str2, toIndex);
	}
@Test
	public void removeAllSuffixTest() {
		final String prefix = "ab";

		String str = "cdefabab";
		String result = CharSequenceUtil.removeAllSuffix(str, prefix);
		assertEquals("cdef", result);

		str = "cdefab";
		result = CharSequenceUtil.removeAllSuffix(str, prefix);
		assertEquals("cdef", result);

		str = "cdef";
		result = CharSequenceUtil.removeAllSuffix(str, prefix);
		assertEquals("cdef", result);

		str = "";
		result = CharSequenceUtil.removeAllSuffix(str, prefix);
		assertEquals("", result);

		str = null;
		result = CharSequenceUtil.removeAllSuffix(str, prefix);
		assertNull(result);
	}