Android String Cut cutRight(final String srcStr, final String cutStr)

Here you can find the source of cutRight(final String srcStr, final String cutStr)

Description

cut Right

Declaration

public static String cutRight(final String srcStr, final String cutStr) 

Method Source Code

//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;
    }
}

Related

  1. safeCut(String str, int length)
  2. safeCutNoDot(String str, int length)
  3. cutString(String str, int length)
  4. cutString(String str, int length, String dot)
  5. cutStringFromChar(String str1, String str2, int offset)
  6. cutoff(String value, int length)
  7. cutString(String str, int length)
  8. cutString(String str, int length, String dot)
  9. cutStringFromChar(String str1, String str2, int offset)