Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String processAsteriskLabel(String labelString) {

        if (labelString == null) {

            return null;

        }

        StringBuffer sb = new StringBuffer("");

        sb.append("<html><body>&nbsp;");

        int index = labelString.lastIndexOf("*");

        if (index > -1) {

            sb.append(labelString.subSequence(0, index));

            sb.append("<font color='red'>*</font>");

        } else {

            sb.append(labelString + "&nbsp;");

        }

        sb.append("</body></html>");

        return sb.toString();

    }
}