Why do a character at a time?

sWithBreak = ""
sSep = ""
lUpper = Int(Len(sText) / iWidth)
For i = 0 to lUpper
        sWithBreak = sWithBreak & sSep & Mid(sText, i * iWidth + 1, iWidth)
        sSep = "<br>"
Next

Regards,
Tore.

-----Original Message-----
From: Pete Lundrigan [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 1:26 AM
To: ActiveServerPages
Subject: RE: Split a String at a Specific Length


I will take my lumps and go to sleep knowing that I should have never
posted to the list.  I apologize for the inconvenience.  You were
correct is was only a couple of lines. I was just having a mental block
or something.

Function InsertBreakatSpecificLength(str,width)
        for i = 1 to len(str)

                if i mod width = 0 then
                mystring = mystring  & mid(str,i,1) & "<br>"
                else
                mystring = mystring  & mid(str,i,1)
                End if 

        next
        InsertBreakatSpecificLength = mystring
End Function

Pete Lundrigan 
Media Resources Center 
Academic Web Support 
316.978.3575  http://www.mrc.twsu.edu/ 
mailto:[EMAIL PROTECTED] 

-----Original Message-----
From: Roji Thomas [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, October 06, 2002 11:55 PM
To: ActiveServerPages
Subject: Re: Split a String at a Specific Length

No I guess.
But y not write it?
Afterall its a matter of a few lines
And u can have that "geek smile"
at the end of the day.



----- Original Message -----
From: "Pete Lundrigan" <[EMAIL PROTECTED]>
To: "ActiveServerPages" <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 9:52 AM
Subject: Split a String at a Specific Length


Is there a function similar to Split to Split a string every 40
characters instead of Splitting at a specific character?

---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to