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

HTML Break 

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.br() API. It converts the line breaks to html <br/> tags.

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

import com.opensymphony.util.TextUtils;

public class HtmlBreakTest {

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

    String str = " ONE \n TWO \n THREE \n FOUR";
    
    //Convert line breaks to html <br/>
    String html = TextUtils.br(str);
    System.out.println(html);
    
  }

}
   

It gives the following output,
 ONE <br/>
 TWO <br/>
 THREE <br/>
 FOUR



 
  


  
bl  br