xsl-list
[Top] [All Lists]

[xsl] Finding first difference between 2 text strings

2009-09-10 10:11:44
The XSLT function "compare" will compare 2 strings and indicate which is
alphabetically first.

Is there any function, or simple transformation, that will tell me the
position of the first character where the two strings differ?

"compare" might determine this, but it isn't telling.  I suppose strings
can be compared in various ways internally, so the position of the first
difference might not be a side-effect of "compare".

Comparing strings can also be time consuming for long strings, so I'd
like an "inexpensive" solution, if there is one.

Any suggestions for finding the first difference in 2 strings (besides a
linear march through the strings in my XSL transformation)?

Thanks, Mike

This email and any attachments are only for use by the intended recipient(s) 
and may contain legally privileged, confidential, proprietary or otherwise 
private information.  Any unauthorized use, reproduction, dissemination, 
distribution or other disclosure of the contents of this e-mail or its 
attachments is strictly prohibited.  If you have received this email in error, 
please notify the sender immediately and delete the original.



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--