tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Open Symphony Core > Wrap Paragraph

Wrap Paragraph 

OSCore (Open Symphony Core) is a java library with lot of utilities and reusable components. This requires the libraries oscore-2.2.6.jar, mail.jar to be in classpath. The following example shows using TextUtils.wrapParagraph() API.

File Name  :  
com/bethecoder/tutorials/oscore/WrapParagraphTest.java 
Author  :  Sudhakar KV
Email  :  [email protected]
   
package com.bethecoder.tutorials.oscore;

import com.opensymphony.util.TextUtils;

public class WrapParagraphTest {

  /**
   @param args
   */
  public static void main(String[] args) {

    String html = TextUtils.wrapParagraph("ONE\n TWO \n\n THREE\n FOUR");
    System.out.println(html);
  }

}
   

It gives the following output,
<p>ONE
 TWO 
</p>

<p> THREE
 FOUR</p>



 
  


  
bl  br