news.pandora.be wrote on 17 mei 2004 in
microsoft.public.inetserver.asp.general:
It's in a sort of message board so I cant realy controle what will be
displayed in the table.
I have to make shure that if someone has put in such long words my
table will still be displayed as it should.
Therefor I'm looking for an ASP-code that places an "<BR>" into my
string if there are words longer than 40 letters in it. It doesn't
realy matter to me where the words are broken as long as they are.
this simple j(ava)script script breaks all words
longer than 40 chars long into 40 char parts
ended by a - and a space:
t = t.replace(/(\S{40})/g,"$1- ")
======================
same in vbscript [longer]:
Set regEx = New RegExp
regEx.Pattern = "(\S{40})"
regEx.Global = True
t = regEx.Replace(t, "$1- ")
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)