Ask a Question related to ASP, Design and Development.
-
Jason #1
A string has no line feeds or cariage retunrs or spaces, need to insert a vbCrLf
When users fill out my text area field, there is a chance that there
will be no line feeds or cariage returns or spaces and just one really
long word. THIS CAUSES A MAJOR PROBLEM! What I am trying to do is
force a vbCrLf if a string is long than 80 characters in a row. So if
a string is a total of 500 characters with no line feeds, spaces, or
returns, I want to force a vbCrLf every 80 characters so that is
doesn't overflow my preview text field on the next page.
Any suggestions on how the algorithm would be for this in VBscript
ASP?
Thanks,
Jason
Jason Guest
-
Spaces/line breaks appear in Contribute
I'm seeing extra line breaks/line feeds when browsing and editing a table filled with addresses and phone numbers in Contribute. The page appears... -
Getting ride of Line Feeds
I have code that reads data from a text document. Here is one name it returned: Sweeny, Katherine Michell e Notice there is a break in 'Michelle'... -
replace spaces with 0's in a string
I have a string like this '00023MJKOP16598 09 00' I need to replace spaces in this string with zeros so that the spaces are gone. So it would... -
line spaces in imported text
I'm trying to loadvars into my flash project, but the text I'm trying to load has spaces in it, which doesn't load in right.. for example: ... -
Line Feeds in Datagrid
Dear all, I'm using a datagrid in a c# asp.net page to display data from a dataset populated from my SQL Server. So far, so good! :-) The... -
Adrienne #2
Re: A string has no line feeds or cariage retunrs or spaces, need to insert a vbCrLf
Gazing into my crystal ball I observed [email]alihamed@msn.com[/email] (Jason) writing in
news:ce214430.0310182205.10363d4e@posting.google.c om:
How about:> When users fill out my text area field, there is a chance that there
> will be no line feeds or cariage returns or spaces and just one really
> long word. THIS CAUSES A MAJOR PROBLEM! What I am trying to do is
> force a vbCrLf if a string is long than 80 characters in a row. So if
> a string is a total of 500 characters with no line feeds, spaces, or
> returns, I want to force a vbCrLf every 80 characters so that is
> doesn't overflow my preview text field on the next page.
>
> Any suggestions on how the algorithm would be for this in VBscript
> ASP?
>
> Thanks,
> Jason
>
for each word in split(request.form("test")," ")
if len(trim(word)) > 5 then
test = test & left(word,5) & vbcrlf & right(word,len(word)-5) & " "
else
test = test & word & " "
end if
next
--
Adrienne Boswell
Please respond to the group so others can share
[url]http://www.arbpen.com[/url]
Adrienne Guest
-
Tom B #3
Re: A string has no line feeds or cariage retunrs or spaces, need to insert a vbCrLf
Your script seems to shorten each word to a maximum of 5 characters?
"Adrienne" <arbpen2003@sbcglobal.net> wrote in message
news:Xns9418F214064EAarbpenyahoocom@207.115.63.158 ...> Gazing into my crystal ball I observed [email]alihamed@msn.com[/email] (Jason) writing in
> news:ce214430.0310182205.10363d4e@posting.google.c om:
>>> > When users fill out my text area field, there is a chance that there
> > will be no line feeds or cariage returns or spaces and just one really
> > long word. THIS CAUSES A MAJOR PROBLEM! What I am trying to do is
> > force a vbCrLf if a string is long than 80 characters in a row. So if
> > a string is a total of 500 characters with no line feeds, spaces, or
> > returns, I want to force a vbCrLf every 80 characters so that is
> > doesn't overflow my preview text field on the next page.
> >
> > Any suggestions on how the algorithm would be for this in VBscript
> > ASP?
> >
> > Thanks,
> > Jason
> >
> How about:
> for each word in split(request.form("test")," ")
> if len(trim(word)) > 5 then
> test = test & left(word,5) & vbcrlf & right(word,len(word)-5) & " "
> else
> test = test & word & " "
> end if
> next
>
> --
> Adrienne Boswell
> Please respond to the group so others can share
> [url]http://www.arbpen.com[/url]
Tom B Guest
-
Tom B #4
Re: A string has no line feeds or cariage retunrs or spaces, need to insert a vbCrLf
Dim iLoop
Dim sWorking
Dim sSection
for iLoop = 0 to len(theString) step 80
sSection=mid(theString,iLoop,80)
if instr(sSection," ") = 0 OR instr(sSection,vbCrLf)=0 then
sWorking=sWorking & sSection & vbCrLf
else
sWorking=sWorking & sSection
end if
next
"Jason" <alihamed@msn.com> wrote in message
news:ce214430.0310182205.10363d4e@posting.google.c om...> When users fill out my text area field, there is a chance that there
> will be no line feeds or cariage returns or spaces and just one really
> long word. THIS CAUSES A MAJOR PROBLEM! What I am trying to do is
> force a vbCrLf if a string is long than 80 characters in a row. So if
> a string is a total of 500 characters with no line feeds, spaces, or
> returns, I want to force a vbCrLf every 80 characters so that is
> doesn't overflow my preview text field on the next page.
>
> Any suggestions on how the algorithm would be for this in VBscript
> ASP?
>
> Thanks,
> Jason
Tom B Guest
-
Aaron Bertrand [MVP] #5
Re: A string has no line feeds or cariage retunrs or spaces, need to insert a vbCrLf
[url]http://tinyurl.com/rhyl[/url]
"Jason" <alihamed@msn.com> wrote in message
news:ce214430.0310182205.10363d4e@posting.google.c om...> When users fill out my text area field, there is a chance that there
> will be no line feeds or cariage returns or spaces and just one really
> long word. THIS CAUSES A MAJOR PROBLEM! What I am trying to do is
> force a vbCrLf if a string is long than 80 characters in a row. So if
> a string is a total of 500 characters with no line feeds, spaces, or
> returns, I want to force a vbCrLf every 80 characters so that is
> doesn't overflow my preview text field on the next page.
>
> Any suggestions on how the algorithm would be for this in VBscript
> ASP?
>
> Thanks,
> Jason
Aaron Bertrand [MVP] Guest
-
Adrienne #6
Re: A string has no line feeds or cariage retunrs or spaces, need to insert a vbCrLf
Gazing into my crystal ball I observed "Tom B"
<shuckle@NOSPAMhotmail.com> writing in
news:#uHLQEklDHA.2080@TK2MSFTNGP10.phx.gbl:
>
> "Adrienne" <arbpen2003@sbcglobal.net> wrote in message
> news:Xns9418F214064EAarbpenyahoocom@207.115.63.158 ...> Your script seems to shorten each word to a maximum of 5 characters?>> Gazing into my crystal ball I observed [email]alihamed@msn.com[/email] (Jason)
>> writing in news:ce214430.0310182205.10363d4e@posting.google.c om:
>>>>>> > When users fill out my text area field, there is a chance that there
>> > will be no line feeds or cariage returns or spaces and just one
>> > really long word. THIS CAUSES A MAJOR PROBLEM! What I am trying to
>> > do is force a vbCrLf if a string is long than 80 characters in a
>> > row. So if a string is a total of 500 characters with no line feeds,
>> > spaces, or returns, I want to force a vbCrLf every 80 characters so
>> > that is doesn't overflow my preview text field on the next page.
>> >
>> > Any suggestions on how the algorithm would be for this in VBscript
>> > ASP?
>> >
>> > Thanks,
>> > Jason
>> >
>> How about:
>> for each word in split(request.form("test")," ")
>> if len(trim(word)) > 5 then
>> test = test & left(word,5) & vbcrlf & right(word,len(word)-5) & " "
>> else test = test & word & " "
>> end if
>> next
>>
Just for testing. It's a little easier to test with 5 characters than 80.
YMMV.
--
Adrienne Boswell
Please respond to the group so others can share
[url]http://www.arbpen.com[/url]
Adrienne Guest
-
Bob Lehmann #7
Re: A string has no line feeds or cariage retunrs or spaces, need to insert a vbCrLf
I have trouble remembering something that happened last week, and you recall
a thread from over three years ago? :>)
Bob Lehmann
"Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
news:uyj3hMmlDHA.2404@TK2MSFTNGP12.phx.gbl...> [url]http://tinyurl.com/rhyl[/url]
>
>
>
>
>
>
> "Jason" <alihamed@msn.com> wrote in message
> news:ce214430.0310182205.10363d4e@posting.google.c om...>> > When users fill out my text area field, there is a chance that there
> > will be no line feeds or cariage returns or spaces and just one really
> > long word. THIS CAUSES A MAJOR PROBLEM! What I am trying to do is
> > force a vbCrLf if a string is long than 80 characters in a row. So if
> > a string is a total of 500 characters with no line feeds, spaces, or
> > returns, I want to force a vbCrLf every 80 characters so that is
> > doesn't overflow my preview text field on the next page.
> >
> > Any suggestions on how the algorithm would be for this in VBscript
> > ASP?
> >
> > Thanks,
> > Jason
>
Bob Lehmann Guest
-
Aaron Bertrand - MVP #8
Re: A string has no line feeds or cariage retunrs or spaces, need to insert a vbCrLf
I vaguely recalled dealing with the situation before (and was surprised I
hadn't entered an article about it). Though you can easily force carriage
returns by placing text within a fixed-width table or div.
It took me about 20 minutes to find that thread, because of my initial
choice of keywords...
"Bob Lehmann" <nospam@dontbotherme.zzz> wrote in message
news:ujuEvxnlDHA.3288@tk2msftngp13.phx.gbl...recall> I have trouble remembering something that happened last week, and you> a thread from over three years ago? :>)
Aaron Bertrand - MVP Guest



Reply With Quote

