Substring and indexof functions

Hi Team,

I have below code:

Var url= context.getVariable('reuest.uri').substring(0, context.getVariable('request.uri').indexOf(..)+"/"+ orgName+"/"+catalog;

Instead of js policy,How can i implement this with any other policies.

Appreciate the support.

 

 

0 3 138
3 REPLIES 3

Thank you.

The docs has substring function. But for indexOf() function, how can we implement apart from js policy, as indexOf() function is not present in the above reference url.

 

Since you're doing substring, you may be able to achieve the same result using one of the replace functions.