Java List Truncate truncateVersionFromModFileName(List fileNames)

Here you can find the source of truncateVersionFromModFileName(List fileNames)

Description

truncate Version From Mod File Name

License

Open Source License

Declaration

static List<String> truncateVersionFromModFileName(List<String> fileNames) 

Method Source Code

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

import java.util.ArrayList;

import java.util.List;

public class Main {
    static List<String> truncateVersionFromModFileName(List<String> fileNames) {
        String pattern = "([a-zA-Z0-9\\s-]+)([-_\\s\\[])(.+)(.jar)";
        List<String> truncatedNames = new ArrayList<>();
        for (String fileName : fileNames) {
            String newName = fileName.replaceAll(pattern, "$1");
            truncatedNames.add(newName.trim());
        }/*from  www. j  ava2  s.  c  om*/
        return truncatedNames;
    }
}

Related

  1. truncateList(final List full, int maxSize)
  2. truncateList(int offset, int count, List originalList)
  3. truncateList(List input, int maxSize)
  4. truncateList(List list, int len)
  5. truncateStringList(List strings, String truncateFrom)