Page 1 of 1
to trim 1th char
Posted: Mon Sep 29, 2008 12:29 am
by sathishmca
Hi to all,
I have a data with 7 characters.i need to remove 1st character if it is 0.
Ex:
0123456 ---> 123456
0012345 ---> 012345
Could you please suggest me some tips?
Posted: Mon Sep 29, 2008 12:38 am
by ray.wurlod
Code: Select all
If Left(InLink.TheString,1) = "0" Then Right(InLink.TheString,6) Else InLink.TheString
What is to happen if the first character is non-zero? You did not include this in your specification.
Thanks
Posted: Mon Sep 29, 2008 12:44 am
by sathishmca
ray.wurlod wrote:Code: Select all
If Left(InLink.TheString,1) = "0" Then Right(InLink.TheString,6) Else InLink.TheString
What is to happen if the first character is non-zero? You did not includ ...
Thaks ray.wurlod..What you have written is correct.If its non zero means can move same as the source.
Re: Thanks
Posted: Mon Sep 29, 2008 12:53 am
by sathishmca
Hi ray,
Any other functions to achive this quit easier than what u gave before?
Posted: Mon Sep 29, 2008 2:38 am
by ray.wurlod
Not from me.
You want to write your own function then go ahead, it will encapsulate the expression logic I gave.
Whether or not U has any other ideas remains to be seen: U does not log in all that often.