funktion för långa rader

ASP

0 svar · 162 visningar · startad av Gimbo

Medlem sedan dec. 20001 626 inlägg
Trådstart#1

har en funktion för långa rader som ser ut på följande sätt:

'FUNKTION FÖR LÅNGA RADER
	function doIt(textSomSkaFixas)
	arrText = split(textSomSkaFixas, " ") 
	for i = 0 To uBound(arrText)
	if Len(arrText(i)) > 35 then
	newText = newText & " " & Left(arrText(i), 35)
	'newText = newText & " " & Right(arrText(i), Len(arrText(i)-35))
	newText = newText & " " & Right(arrText(i), Len(arrText(i))-35)
	else
	newText = newText & " " & arrText(i)
	end if
	next
	doIt = newText
	end function

nu är det så att den splittra en lång rad, dvs efter 35 tecken så slittrar den raden skillt med ett mellanslag, men hur gör jag ifall jag vill att den ska radbryta efter 35tecken... har testat följande men det fungerar inte...

' FUNKTION FÖR LÅNGA RADER
	function doIt(textSomSkaFixas)
	arrText = replace(split(textSomSkaFixas), "vbcrlf ", "<br>") 
	for i = 0 To uBound(arrText)
	if Len(arrText(i)) > 35 then
	newText = newText & " " & Left(arrText(i), 35)
	'newText = newText & " " & Right(arrText(i), Len(arrText(i)-35))
	newText = newText & " " & Right(arrText(i), Len(arrText(i))-35)
	else
	newText = newText & " " & arrText(i)
	end if
	next
	doIt = newText
	end function
249 ms totalt · 4 externa anrop · v20260731065814-full.d34c6d5a
124 ms — deklarationer (db)
0 ms — hämta statistik (cache)
122 ms — hämta tråd, inlägg och bilagor (db)
123 ms — ändringar (db)