Java List Trim trimSuffix(List strs)

Here you can find the source of trimSuffix(List strs)

Description

trim Suffix

License

Apache License

Declaration

private static List<String> trimSuffix(List<String> strs) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Arrays;
import java.util.List;

public class Main {
    private static final List<String> SUFFIXES = Arrays.asList("preview");

    private static List<String> trimSuffix(List<String> strs) {
        String endStr = strs.get(strs.size() - 1);
        if (SUFFIXES.contains(endStr)) {
            strs.remove(strs.size() - 1);
        }//w w  w  .  j  ava 2s . c o  m
        return strs;
    }
}

Related

  1. trimListValues(List original)
  2. trimSequence(int m, List sequence)
  3. trimStringLineList(List lines)
  4. trimStrings(List list)
  5. trimStringToNewList(List list, Boolean isLower)
  6. trimToList(String importOrder1)
  7. trimToSize(List listToTrim, int size)