Results 1 to 2 of 2
  1. #1
    Eric is offline Senior Member
    Join Date
    Jun 2007
    Posts
    111
    Rep Power
    0

    Default To truncate jump of line in jsp

    It wanted to know how can I truncate a jump of line in jsp, because I have a var that I rescue from the data base that it's flood of line jumps which they cause that when prints this var in jsp it is left a disaster I have used the methods, replace and replaceall, trying to replace \n by an empty space….

    Eric

  2. #2
    Daniel is offline Member
    Join Date
    Jun 2007
    Posts
    91
    Rep Power
    0

    Default RE: To truncate jump of line in jsp

    Test this, surely that it is going to works:

    Java Code:
                    col1=col1.replaceAll("\\n"," ");
                    col1=col1.replaceAll("\\t"," ");
                    col1=col1.replaceAll("\\r"," ");
                    col1=col1.replaceAll("\\v"," ");
                   
                    col1=col1.replaceAll("\\chr(9)"," ");
                    col1=col1.replaceAll("\\chr(10)"," ");
                    col1=col1.replaceAll("\\chr(13)"," ");
                    //col1=col1.replaceAll("\\-"," ");
    Take care of that it validates those to him that knew that they were jumps of line of tabulator, vertical tabulator etc.

    Daniel:o

Similar Threads

  1. new line within a string
    By perplexingtrax in forum New To Java
    Replies: 8
    Last Post: 04-16-2013, 08:17 PM
  2. New Line in FlowLayout
    By chris12295 in forum New To Java
    Replies: 1
    Last Post: 12-07-2007, 05:49 PM
  3. Eclipse- jump to method definition
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-07-2007, 03:34 PM
  4. Reading in data from file line by line
    By bluekswing in forum New To Java
    Replies: 1
    Last Post: 10-02-2007, 12:19 AM
  5. how to know the number of the line
    By simon in forum New To Java
    Replies: 3
    Last Post: 08-01-2007, 04:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •