Java Array Element Get getArgPairsSeparatedByChar(String[] args, String separator)

Here you can find the source of getArgPairsSeparatedByChar(String[] args, String separator)

Description

get Arg Pairs Separated By Char

License

Open Source License

Declaration

public static Map<String, String> getArgPairsSeparatedByChar(String[] args, String separator) 

Method Source Code

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

import java.util.HashMap;

import java.util.Map;

public class Main {
    public static Map<String, String> getArgPairsSeparatedByChar(String[] args, String separator) {
        Map<String, String> argPairs = new HashMap<String, String>();
        if (args != null) {
            // find pairs separated by the = sign
            for (String argPair : args) {
                String[] pair = argPair.split("=");
                if (pair.length > 1) {
                    argPairs.put(pair[0], pair[1]);
                }/*from  www .  j  a  v a2  s .c  om*/
            }
        }
        return argPairs;
    }
}

Related

  1. get(Object[] array, int index)
  2. get(T[] array, int index)
  3. get(T[] array, int index)
  4. get(T[] array, int index)
  5. getAllMatches(String[] target, String[] pattern)
  6. getArgs(final String[] args, final String[] defaultValue, final String... flags)
  7. getArgs(String[] args, String... singleArgs)
  8. getArgsOption(String[] args, String option)
  9. getArrayNoNull(Object[] array)