Java List Trim trimEndDigital(List strs)

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

Description

trim End Digital

License

Apache License

Declaration

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

Method Source Code

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

import java.util.List;

public class Main {
    private static List<String> trimEndDigital(List<String> strs) {
        String endStr = strs.get(strs.size() - 1);
        try {/*from   www . jav  a 2  s . co m*/
            Integer.parseInt(endStr);
            //has number .remove last
            strs.remove(strs.size() - 1);
        } catch (NumberFormatException e) {
            return strs;
        }
        return strs;
    }
}

Related

  1. toStringList(List list, String delimiter, boolean isTrim, boolean isRemoveEmpty)
  2. trim(final List row)
  3. trim(List data, boolean removeEmptyLines)
  4. trim(List strs)
  5. trimElements(List list)
  6. trimIfLastIndex(List suggestedList, String suggestedWords, int i)
  7. trimKeyFormat(String s3KeyFormat, List disallowedKeys)
  8. trimLeadingWhitespaces(List lines)
  9. trimList(List list)