Java Terminal Bold Output boldText(String str)

Here you can find the source of boldText(String str)

Description

Creates a string with high intensity (bold).

License

Open Source License

Parameter

Parameter Description
str String to be styled bold.

Return

String with internal markup-sequences.

Declaration

public static String boldText(String str) 

Method Source Code

//package com.java2s;
//License/*from   www  . j a va2 s. co m*/

public class Main {
    /**
     * Defines the internal marker string for style/color markups.
     */
    public static final String INTERNAL_MARKER = "\001";
    /**
     * Defines the markup representation of the activator for style bold
     * (normally represented by high intensity).
     */
    public static final String BOLD = "f";
    /**
     * Defines the markup representation of the deactivator for style bold.
     */
    public static final String BOLD_OFF = "d";

    /**
     * Creates a string with high intensity (bold).
     * 
     * @param str
     *            String to be styled bold.
     * @return String with internal markup-sequences.
     */
    public static String boldText(String str) {
        return INTERNAL_MARKER + BOLD + str + INTERNAL_MARKER + BOLD_OFF;
    }
}

Related

  1. bold(String msg)
  2. bold(String str)
  3. boldcolorizeText(String str, String color)
  4. boldcolorizeText(String str, String fgc, String bgc)