Re: FN-FORUM: XSLT Replace
date posted 23rd January 2006 21:03
Andy Macnaughton-Jones wrote:
> So does translate remove any instance of any character in the string
> ?
That's right. So, for example,
translate('some string', 's', '')
will remove both 's' characters from 'somestring' and
translate('some string', 's ', '')
will remove both 's' characters together with the space. As I said
before, the second and third string are both processed a character at a
time. In fact, your original code should really have been written:
translate('IWD2-C2K-12345', 'IWD2-CK', '')
as the repetition of the '2' and the '-' is pointless.
> I presumed (it would seem wrongly) that it works like replace -
> although I was intending to use it because replace doesn't appear to
> be available to me.
XPath doesn't have a 'replace' function.
> Anyhow, I'm using substring now to strip the first 10 characters off
> the start of the string.
That's probably your best approach.
Dave...