Here you can find the source of truncateExtension(String name)
Parameter | Description |
---|---|
name | a parameter |
public static String truncateExtension(String name)
//package com.java2s; public class Main { /**//from ww w . jav a 2 s.c om * Truncates the extension of the file name. For example x.html will return x. If there is no extension, * the full name will be returned. * * @param name * @return */ public static String truncateExtension(String name) { return name.lastIndexOf('.') == -1 ? name : name.substring(0, name.lastIndexOf('.')); } }