Java Map Replace replaceString(Map bodyToReplace, String replacingContent)

Here you can find the source of replaceString(Map bodyToReplace, String replacingContent)

Description

replace String

License

Open Source License

Declaration

public static String replaceString(Map<String, Object> bodyToReplace, String replacingContent) 

Method Source Code

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

import java.util.Map;

public class Main {
    public static String replaceString(Map<String, Object> bodyToReplace, String replacingContent) {

        for (Map.Entry<String, Object> entrySet : bodyToReplace.entrySet()) {
            System.out.println(entrySet.getKey() + "\n\n String to replace\n\n" + entrySet.getValue());
            replacingContent = replacingContent.replace(entrySet.getKey(), String.valueOf(entrySet.getValue()));

        }/*from   w  w w .ja v a2  s  .c om*/

        return replacingContent;
    }
}

Related

  1. replacePlaceholders(String script, Map configurations)
  2. replacePlaceholders(String string, Map values)
  3. replaceProperties(final CharSequence string, final Map properties)
  4. replaceQueryParameterInUrl(String fullUrl, Map newParameter)
  5. replaceSeparator(String value, String separator, Map map)
  6. replaceString(String source, Map args)
  7. replaceString(String uri, String baseURI, Map prefixes)
  8. replaceTemplates(String template, Map entries)
  9. replaceTokens(String inputString, Map tokenMap)