Here you can find the source of yearFromFileName(String str)
Parameter | Description |
---|---|
str | filename |
public static int yearFromFileName(String str)
//package com.java2s; //License from project: Open Source License public class Main { /**//from ww w. j av a 2s . co m * Filename Eg : en.13.3.1.2009.6.11 * @param str filename * @return year from filename */ public static int yearFromFileName(String str) { try { return Integer.parseInt(str.split("\\.")[4]); } catch (ArrayIndexOutOfBoundsException e) { return -1; } } }