Link to home
Start Free TrialLog in
Avatar of JElster
JElsterFlag for United States of America

asked on

How to translate this JS to C#

Hi..
I have the following JS code..
How do I translate this to C#?

I think Dictionary is the same as MAP in C#, what about parmas.get  and keyset??

(getAuthTemplateTag returns a constant- not an issue)

thx

public final String createAuthTemplateXML(Map<String, String> params) {
            StringBuilder sb = new StringBuilder();
            sb.append("<authRequest>").append("\n").append("<")
                        .append(getAuthTemplateTag()).append(">").append("\n");

            for (String key : params.keySet()) {
                  sb.append("<").append(key).append(">").append(params.get(key))
                              .append("</").append(key).append(">").append("\n");
            }
            sb.append("</").append(getAuthTemplateTag()).append(">").append("\n")
                        .append("</authRequest>").append("\n");

            return sb.toString();
      }
ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JElster

ASKER

Wow... you're amazing.. thx again!