reverse string example without using strrev function

Hi all,

can anybody give example program on reverse string without using strrev function through x++?

Thanks,

moulali.

str revString(str strVar)

{

int i;

str temp;

str retVar;

;

strLen=strVar.length()

for(i=strLen;i>=1;i++){

temp =SubStr(strVar,i,1);

retVar +=temp;

}

return retvar ;

}

plz check whthr it is working or not .

tc.

hi,

try this it will work…

static void revString(args _args)
{
int i = 1;
str temp;
str retVar;
str strvar = “chaitu”;
int l = 0;
;

l = strlen(strvar);
for(i=l;i>=1;i–)
{
temp =SubStr(strVar,i,1);
retVar +=temp;
}
info(retvar);
}