|
|
 |
Re: FN-FORUM: XSLT Replace
date posted 23rd January 2006 20:12
Andy Macnaughton-Jones wrote:
> Hi,
> I suspect it's to do with escaping, but why does this;
>
> translate('IWD2-C2K-12345', 'IWD2-C2K-', '')
>
> Return me a value of 1345 ?
I'm not sure why that's confusing. Seems to be doing exactly what I'd
expect.
translate takes three strings as arguments. It returns the first string
with all characters from the second string replaced with the
corresponding character from the third string. If there is no
corresponding character in the third string (i.e. if the second string
is longer than the third string) then the character is removed.
In this case the third string is empty, so all characters that appear in
the first string are removed. Which is what you are seeing.
What were you expecting to see?
Dave...
|
 |
|