• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Break Down Paragraph Text

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My department has a custom software application that breaks down a text paragraph into lines that contain 80 characters or less. I need to write a custom application using JSP to do the same thing. Any help would be appreciated.

i.e. Text Area (Paragraph)

PO John Smith reports responding to the above location and checking the aforementioned building. All appears secure at this time.

Stored in the SQL Database it would appear �

Line 1: PO John Smith reports responding to the above location and checking the
Line 2: aforementioned building. All appears secure at this time.
 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the form containing the text area is submitted to its servlet, simply use the String.substring() method to break the text area submission into 80-character chunks for storage.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I took this as a personal challenge... so I hope it helps...
 
Bernard Bobinski
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear and James,

Thank you very much for the help. You guys got me started in the right direction. This is the code that I eventually ended up using.

 
reply
    Bookmark Topic Watch Topic
  • New Topic