Page 1 of 1

Substring to grab last three

Posted: Wed May 07, 2008 1:54 pm
by shrey3a
Hi,

I have a requirment to always grab last three charcters from string i.e.

123456 ans= 456
I tried couple of optios but it chops like substring, left, right but nothing seems to work,

Right(Arg1, len(Arg1) - 3)

regards,

Posted: Wed May 07, 2008 2:37 pm
by narasimha
Right(Arg1,3)
Or did I miss something from your requirement?

Posted: Wed May 07, 2008 3:13 pm
by shrey3a
Actually the requirment is to cut string in b/w 3 and 4th instance of identifier , I was not bale to post it correctly first time i.e.

1111%11111%RESULT%11111% = RESULT

Regards


narasimha wrote:Right(Arg1,3)
Or did I miss something from your requirement?

Posted: Wed May 07, 2008 3:24 pm
by narasimha
Assuming '%' is your delimiter, use

Code: Select all

Field(Arg1,'%',3)

Posted: Wed May 07, 2008 4:35 pm
by shrey3a
Thanks a lot

[quote="narasimha"]Assuming '[b]%[/b]' is your delimiter, use

[code]Field(Arg1,'%',3)[/code][/quote]