Page 1 of 1

TRIM function

Posted: Tue Oct 25, 2011 9:41 pm
by just4u_sharath
Hello,
I want to trim the leading and trailing occurance of *.
Input field = ***abc***. output should be abc

If i use TRIM(***abc****,'*','B') but i am getting the output as
abc***. In the help section i found that B will remove all the leading and trailing characters.

Just Trim(***abc****,'*') gave me abc*

Thanks

Re: TRIM function

Posted: Tue Oct 25, 2011 9:52 pm
by SURA
Trim (Col,'*','A')

Ereplace also help you.

Refer the help.


DS User

Re: TRIM function

Posted: Wed Oct 26, 2011 4:03 am
by BI-RMA
just4u_sharath wrote:If i use TRIM(***abc****,'*','B') but i am getting the output as
abc***.
In my 8.0.1 FP1a installation I get 'abc' for TRIM(DUMMY,'*','B') where DUMMY has the value '***abc****'. The TRIM-function you quoted is invalid (missing quotes).
What version are You running?

Edit: TRIM(DUMMY,'*') returns the same.

Re: TRIM function

Posted: Wed Oct 26, 2011 5:54 am
by max.madsen
Do you want remove only leading and trailing characters? not all characters?
E.g.:
The result for "***ab*c***" and "***abc*****" will be different?

If you dont have success with "trim", try use "convert" function.
Convert("*","",DUMMY)

Best regards!