This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: counting the number of tokens in a string?
- From: Oleg Tkachenko <olegt at multiconn dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 02 Oct 2002 20:00:14 +0200
- Subject: Re: [xsl] counting the number of tokens in a string?
- Organization: Multiconn International Ltd
- References: <20021002163544.27192.qmail@web12504.mail.yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
john liao wrote:
another newbie question. Is there an easy way to count
the number of commas in a string? Like this:
<ITEM cols="col1,col2,col3,col4"/>
What about
string-length($str) - string-length(translate($str,',',''))
--
Oleg Tkachenko
Multiconn International, Israel
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list