Java String Truncate truncateFileType(String p)

Here you can find the source of truncateFileType(String p)

Description

truncate File Type

License

Open Source License

Declaration

public static String truncateFileType(String p) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String truncateFileType(String p) {
        int indexOfPeriod = p.lastIndexOf(".");

        if (indexOfPeriod < 0)
            return p;
        else {/*from  w ww  .j  a  va2s.  c  o  m*/
            return p.substring(0, indexOfPeriod);
        }
    }
}

Related

  1. truncateData(String data, int idLength)
  2. truncateDatabaseName(String db)
  3. truncatedStr(String s, int maxLength)
  4. truncateExtension(String name)
  5. truncateFileName(String agent, String s)
  6. truncateFirstEnd(String str)
  7. truncateHashToInt(String hash)
  8. truncateIfTooLong(String string, int maxLength)
  9. truncateIgnoreCase(String aString, String trailingSubString)