[xsl] Algorithm for splitting a string at a space

Subject: [xsl] Algorithm for splitting a string at a space
From: "Rick Quatro rick@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 23 Nov 2015 19:04:22 -0000
Hello,

I have a series of strings that I need to split if they are longer than a
particular length, say 30 characters. But I need to make the split at the
previous space. Here is an example string:

This is a long line that I want to split at a space.

The 30th character is in the middle of a word, so I need to do the split at
the previous space. I am using XSLT/XPath 2.0. I am having trouble
developing a good algorithm for this. Any pointers would be appreciated.

Rick

Current Thread