469,323 Members | 1,506 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Break string length when it has reached the max.

I have a ASP page that displays text and when somebody does this zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzz it breaks the page. How to restrict this and how to break this single line as multiple line display that as like a paragraph.Can anyone help me...... Thanks.
Jun 25 '08 #1
1 1748
jhardman
3,406 Expert 2GB
Are you saying it breaks the visual formatting of the page?

I'm not sure how you would code it in JScript, but in VBScript, it would be something like this:
Expand|Select|Wrap|Line Numbers
  1. do until longString = ""
  2.    if len(longString) < 101 then
  3.       response.write longString
  4.       longString = ""
  5.    else
  6.       leftside = left(longString, 100)
  7.       if instr(leftside, " ") = 0 then
  8.          response.write leftside & " "
  9.          longString = right(longString, len(longString)-100)
  10.       else
  11.          response.write left(longString, instr(longString, " ")) & " "
  12.          longString = right(longString, len(longString)-instr(longString, " "))
  13.       end if
  14.    end if
  15. loop
I hope the conversion to jscript isn't too hard, let me know if this helps.

Jared
Jun 25 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by ALI-R | last post: by
2 posts views Thread by Paul Hobbs | last post: by
4 posts views Thread by priyanka | last post: by
121 posts views Thread by swengineer001 | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.