Java List Trim trimKeyFormat(String s3KeyFormat, List disallowedKeys)

Here you can find the source of trimKeyFormat(String s3KeyFormat, List disallowedKeys)

Description

trim Key Format

License

Apache License

Declaration

public static String trimKeyFormat(String s3KeyFormat,
            List<String> disallowedKeys) 

Method Source Code

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

import java.util.List;

public class Main {
    public static String trimKeyFormat(String s3KeyFormat,
            List<String> disallowedKeys) {
        int lowestIndex = s3KeyFormat.length();

        for (String disallowedKey : disallowedKeys) {
            int index = s3KeyFormat.indexOf(disallowedKey);
            if (index != -1 && index < lowestIndex) {
                lowestIndex = index;/*w  w w  . j  a  va  2s . c om*/
            }
        }

        if (lowestIndex == -1) {
            return s3KeyFormat;
        }

        return s3KeyFormat.substring(0, lowestIndex);
    }
}

Related

  1. trim(List data, boolean removeEmptyLines)
  2. trim(List strs)
  3. trimElements(List list)
  4. trimEndDigital(List strs)
  5. trimIfLastIndex(List suggestedList, String suggestedWords, int i)
  6. trimLeadingWhitespaces(List lines)
  7. trimList(List list)
  8. trimList(List source)
  9. trimListValues(List original)