Here you can find the source of cutRight(final String srcStr, final String cutStr)
public static String cutRight(final String srcStr, final String cutStr)
//package com.java2s; public class Main { public static String cutRight(final String srcStr, final String cutStr) { if (srcStr == null || cutStr == null) { return srcStr; }//w w w . jav a 2 s .co m String retStr = srcStr; if (retStr.endsWith(cutStr)) { retStr = retStr.substring(0, retStr.length() - cutStr.length()); // cutStr // abschneiden } return retStr; } }