Java String Strip stripExtension(String filename)

Here you can find the source of stripExtension(String filename)

Description

strip Extension

License

Open Source License

Parameter

Parameter Description
filename a parameter

Return

String

Declaration

public static String stripExtension(String filename) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Manchester Centre for Integrative Systems Biology
 * University of Manchester/*from  w  ww.  j a  v  a 2 s. c om*/
 * Manchester M1 7ND
 * United Kingdom
 * 
 * Copyright (C) 2007 University of Manchester
 * 
 * This program is released under the Academic Free License ("AFL") v3.0.
 * (http://www.opensource.org/licenses/academic.php)
 *******************************************************************************/

import java.util.*;

public class Main {
    /**
     * 
     * @param filename
     * @return String
     */
    public static String stripExtension(String filename) {
        final String SEPARATOR = "."; //$NON-NLS-1$
        final StringTokenizer tokenizer = new StringTokenizer(filename, SEPARATOR);
        return tokenizer.nextToken();
    }
}

Related

  1. collectionToString(Collection collection, boolean stripPackageNames)
  2. strip(final String s)
  3. strip(String string, String token)
  4. stripBadHTMLTags(String s)
  5. stripClassFromClassName(String className)
  6. stripLastElement(String str)
  7. stripLeadingSlash(String str)
  8. stripNamespaceDeclarations(String xml)
  9. stripTags(final String tagged)