public static String replaceLeadingSpacesWithNbsps (String str)
    {
        // todo: support for tabs?
        Matcher m = _LeadingSpacesPattern.matcher(str);
        StringBuffer buf = new StringBuffer();
        while (m.find()) {
            int spaceCount = m.group(1).length();
            m.appendReplacement(buf, AWUtil.repeatedString("&nbsp;", spaceCount));
        }
        m.appendTail(buf);
        return buf.toString();
    }
public static String replaceLeadingSpacesWithNbsps (String str)
    {
       
        Matcher m = _LeadingSpacesPattern.matcher(str);
        StringBuffer buf = new StringBuffer();
        while (m.find()) {
            int spaceCount = m.group(1).length();
            m.appendReplacement(buf, AWUtil.repeatedString("&nbsp;", spaceCount));
        }
        m.appendTail(buf);
        return buf.toString();
    }
public static string replaceleadingspaceswithnbsps (string str) { matcher m = _leadingspacespattern.matcher(str); stringbuffer buf = new stringbuffer(); while (m.find()) { int spacecount = m.group(1).length(); m.appendreplacement(buf, awutil.repeatedstring("&nbsp;", spacecount)); } m.appendtail(buf); return buf.tostring(); }