---
title: "funktion för långa rader"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/62765-funktion-för-långa-rader"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Gimbo"
published: "2002-12-20T15:22:49.000Z"
updated: "2002-12-20T15:22:49.000Z"
replies: 0
views: 162
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/62765-funktion-för-långa-rader"
---

# funktion för långa rader

## #1 — Gimbo, 2002-12-20T15:22Z

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
```

Permalänk: https://www.webforum.nu/p/62765

---

Tråden på webben: https://www.webforum.nu/amne/asp/62765-funktion-för-långa-rader
