Page 1 of 1

Convert function ??

Posted: Mon Apr 11, 2011 12:38 pm
by Nagac
i know the syntax of convert() function ..But wanted to know the usage of that function ??

ex :

Input : nar(e)-sh
expected output : naresh

please tell me the exact function ?? with example??

Posted: Mon Apr 11, 2011 1:35 pm
by jwiles
This function has been extremely well-discussed within the forum.

You say that you know the syntax: Convert(fromlist,tolist,expression)
The function converts the characters listed in string fromlist to the characters listed in string tolist when found in the string expression.

Fairly straightforward:
- Do you know what characters you want to replace?
- Do you know what you want to replace them with?
- Do you know what string you want to apply this conversion to?

Plug those answers into the function template. The output is the converted string.

Remember: This is character replacement, not string replacement. If you need string replacement, use ereplace in a basic transformer, pxEReplace available here on the site or code your own function.

Regards,

Posted: Mon Apr 11, 2011 1:37 pm
by kumar_s
Did you try Convert('(e)-','',Input.Filed)

Posted: Mon Apr 11, 2011 2:02 pm
by MarkB
kumar_s wrote:Did you try Convert('(e)-','',Input.Filed) ...
I don't think that is what he wants, as that would remove the 'e'. On the other hand, Convert('()-','',"nar(e)-sh") should result in naresh.