Java HTML htmlFormat(String input)

Here you can find the source of htmlFormat(String input)

Description

html Format

License

Apache License

Declaration

public static String htmlFormat(String input) 

Method Source Code

//package com.java2s;
/*/*from   w ww .j  a v  a 2  s  .c om*/
 * Copyright 2012 jMethods, Inc. 
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

public class Main {
    public static String htmlFormat(String input) {
        input = input.replaceAll("\n", "<br>");
        input = input.replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
        return "<html><body><table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>" + input
                + "</td></tr></table></body></html>";
    }
}

Related

  1. htmlFilenameForClass(Class c)
  2. HTMLFilter(String the_txt)
  3. htmlFilter(String value)
  4. htmlFilterToEmpty(String value)
  5. htmlFooter()
  6. htmlFormatText(String line1, String line2)
  7. htmlHashTag(final String tagName)
  8. htmlHeaderGen(String errorMsg)
  9. htmlify(String str)