Android String Sub String Get delSuffix(String str)

Here you can find the source of delSuffix(String str)

Description

del Suffix

Declaration

public static String delSuffix(String str) 

Method Source Code

//package com.java2s;

public class Main {

    public static String delSuffix(String str) {
        int index = str.lastIndexOf(".");
        if (index >= 0) {
            return str.substring(0, index);
        } else {//from   www.  j  av  a  2 s . c om
            return str;
        }
    }
}

Related

  1. left(String str, int length)
  2. right(String str, int length)
  3. deleteLast(String str, int num)
  4. deleteLastIf(String str, String eq_str)
  5. getTailorString(String string, int length)
  6. mid(String str, int beginIndex, int length)