Questions you are going to have to answer for your self.
What constitutes a word? Spaces, Dashes, Punctuation?
What constitutes 'about' 400 chars?
As close as possible but under?
First word that goes over?
The closest either over or under?
But you should be able to get somewhere if you treat your string as a
list with spaces and|or other characters as delimiters. Real basic
starter code, completely untried and untested.
<cfset string = "The quick brown fox jumped over the lazy dog">
<cfset subString = "">
<cfloop list="#string#" index="word">
<cfset subString = subString + word>
<cfif len(subString) GT 10>
<cfoutput>#subString#<br/></cfoutput>
<cfset subString = "">
</cfif>
</cfloop>
<cfoutput>#subString#</cfoutput>
|