/t5/coldfusion-discussions/split-string-after-full-word/td-p/119604Dec 03, 2008
Dec 03, 2008
Copy link to clipboard
Copied
Hi everyone,
I have some dynamic text which is shown completely if it has
less then 280 characters.When it has more then 280 characters I
display the first 280 and after that I just set 3 dots"...". Now my
question was if it is possible to display the 3 dots after the last
full word after those 280 characters.
Example Now: "this is just an examp..." (cuts of the word)
Example how it should be: "this is just an example." (shows
the whole word an cuts of afterwards)
"Abbreviates a given string to roughly the given length,
stripping any
tags, making sure the ending doesn't chop a word in two, and
adding an
ellipsis character at the end."
Thanks for the reply but this function gives me the same
output as I had before. It limits the string that's good, but if it
has reached the limit it cuts of the word and puts "..." after it.
I'm searching for a way to not cut up the final word into pieces,
so the last word should be completely visible and after that there
should be 3 dots "...", not in the middle of a word.
"Abbreviates a given string to roughly the given length,
stripping any
tags, making sure the ending doesn't chop a word in two, and
adding an
ellipsis character at the end."
/t5/coldfusion-discussions/split-string-after-full-word/m-p/119609#M11383Dec 04, 2008
Dec 04, 2008
Copy link to clipboard
Copied
Retrieve all 280 characters, and then use the string
functions to search backwards and remove all characters AFTER the
LAST space in the 280 character string.
The online documentation will tell you all you need to know
about string manipulation functions.