Hello @Gandla, Srikanth - You'll want to review Transformation Policies in API Management as well as the Policy Expressions feature.
Specifically, the <set-body>
policy and its support for Liquid templates, please refer to: Using Liquid templates with set body
The Liquid templating language provides a host of operations that'll come in very handy when dealing with data transformations in APIM. Depending on what you're trying to do, the use of Liquid templates may be a lot cleaner approach, here's a basic sample where we're using the Upcase filter on a simple "hello world" text:
For more complex scenarios, you might handle it in a pure, vanilla C# way using the Policy Expressions feature and its support for the System.String
& other supporting types & different operations made available by them: https://learn.microsoft.com/en-us/azure/api-management/api-management-policy-expressions#CLRTypes
I hope this helps, let me know if you had any further questions regarding any of the above.