<%
Function limitaCaratteri(frase, lunghMax)
dimMax = LEN(frase)
if dimMax > lunghMax then
estrattoBreve = “”
ultimoCarattere = “a”
contatore = lunghMax
Function limitaCaratteri(frase, lunghMax)
dimMax = LEN(frase)
if dimMax > lunghMax then
estrattoBreve = “”
ultimoCarattere = “a”
contatore = lunghMax
while ultimoCarattere <> ” “
estrattoBreve = LEFT(frase,contatore)
ultimoCarattere = RIGHT(estrattoBreve,1)
contatore = contatore – 1
if contatore = 0 then
ultimoCarattere = ” “
end if
wend
if contatore <> 0 then
estrattoBreve = LEFT(frase,contatore) & “…”
else
estrattoBreve = LEFT(frase,lunghMax)
end if
else
estrattoBreve = frase
end if
limitaCaratteri = estrattoBreve
End Function
%>
limitaCaratteri(descr, 80)
ASP – Troncare una stringa senza troncare le paroleultima modifica: 2010-02-16T23:37:00+01:00da
Reposta per primo quest’articolo