Java Map Replace zipToMap(String[] searchStrings, String[] replacements)

Here you can find the source of zipToMap(String[] searchStrings, String[] replacements)

Description

zip To Map

License

Open Source License

Declaration

private static Map<String, String> zipToMap(String[] searchStrings, String[] replacements) 

Method Source Code


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

import java.util.HashMap;
import java.util.Map;

public class Main {
    private static Map<String, String> zipToMap(String[] searchStrings, String[] replacements) {
        Map<String, String> map = new HashMap<>();
        for (int i = 0; i < searchStrings.length; ++i) {
            map.put(searchStrings[i], replacements[i]);
        }//from w  w w  . j  a v  a  2 s .c  o  m
        return map;
    }
}

Related

  1. replaceVariables(String chart, Map variables)
  2. replaceVars(String origString, Map vars)
  3. replaceVars(String s, Map m)
  4. stringReplace(Map map, String line)
  5. unescape(String cooked, char escapeChar, Map replacements)