Here you can find the source of boldIf(String str, boolean bold)
Parameter | Description |
---|
public static String boldIf(String str, boolean bold)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w. j av a2 s. c om*/ * Makes a string bold if condition bold is true. * Uses html to make the changes. * Do not forget to add <html></html> into your string! * * @param str: string to make bold (eventually) * @param bold: surrounds string with <b> on true * @return str or <b>str</b> */ public static String boldIf(String str, boolean bold) { if (bold) { return bold(str); } else { return str; } } /** * Make String bold. * * @param str * @return */ public static String bold(String str) { return "<b>" + str + "</b>"; } }