Hi!
I have a database where i story names in various lengths, say from 5 to 25 chars, and which can consist of any amount of words.
now i want to put them in a table nicely, but lets say the table isn't wide enough to make a 25 char string fit. so i would like to trim the strings that they fit. I've seen one site do it very intelligently, they didn't cut off after just say 15 chars, but somehow checked if the name consists of more than one word, they checked until which word it would fit in the table, and then cut after that word.
now, i don't know how to do this nicely. i could build various for and if blocks which check for that, but i guess there is a better solution. perhaps through the use of regex ? any help would be greatly appreciated.
mats