JElster
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 (">").appe nd("\n");
for (String key : params.keySet()) {
sb.append("<").append(key) .append("> ").append( params.get (key))
.append("</").append(key). append(">" ).append(" \n");
}
sb.append("</").append(get AuthTempla teTag()).a ppend(">") .append("\ n")
.append("</authRequest>"). append("\n ");
return sb.toString();
}
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<
StringBuilder sb = new StringBuilder();
sb.append("<authRequest>")
.append(getAuthTemplateTag
for (String key : params.keySet()) {
sb.append("<").append(key)
.append("</").append(key).
}
sb.append("</").append(get
.append("</authRequest>").
return sb.toString();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER