<p>
Converts the given text to title case smartly.
</p>

@param text
Text to be converted
@param intCaps
An internal capitalized word list
@return a nice styled title
519894
public static String titleize(final String text, final String[] intCaps)
    {
        String str = text.toLowerCase(Locale.ENGLISH).replaceAll("[\\s_]+", SPACE).trim();
        return titleize(str, SPACE, intCaps);
    }
1319265
public static String capitalize(String s) {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < s.length(); i++) {
      char c = s.charAt(i);
      if (i == 0 || i > 0 && !Character.isLetterOrDigit(s.charAt(i - 1))) c = Character.toUpperCase(c);
      else c = Character.toLowerCase(c);
      result.append(c);
    }
    return (result.toString());
  }
871969
public void setText (String text) {
		if (content instanceof VisLabel) {
			((VisLabel) content).setText(text);
		} else {
			setContent(new VisLabel(text));
		}
		pack();
	}
431411
public static String toTitleCase(CharSequence input) {
      if (input == null) {
         return null;
      }
      return StringFunctions.TITLE_CASE.apply(input.toString());
   }
518757
static String hepburn(
        CharSequence text,
        int offset
    ) {

        StringBuilder sb = null;
        int n = Math.min(text.length(), offset + 32);

        for (int i = offset; i < n; i++) {
            final char c = text.charAt(i);
            char std;
            if (i == offset) { // capitalization
                std = ((c == '\u00D4') || (c == '\u00F4') || (c == '\u014D') ? '\u014C' : Character.toUpperCase(c));
                std = ((c == '\u00DB') || (c == '\u00FB') || (c == '\u016B') ? '\u016A' : std);
            } else {
                std = ((c == '\u00D4') || (c == '\u00F4') || (c == '\u014C') ? '\u014D' : Character.toLowerCase(c));
                std = ((c == '\u00DB') || (c == '\u00FB') || (c == '\u016A') ? '\u016B' : std);
            }
            std = ((c == '\'') ? '\u2019' : std); // use ’ as apostroph
            std = ((c == ' ') ? '-' : std); // use hyphen instead of space
            if ((sb != null) || (std != c)) {
                if (sb == null) {
                    sb = new StringBuilder(32);
                    sb.append(text.subSequence(offset, i));
                }
                sb.append(std);
            }
        }

        return ((sb == null) ? text.subSequence(offset, n).toString() : sb.toString());

    }
1055683
public static String getBoldHTMLText(final String text) {
        String boldStr = null;
        if (text != null) {
            final StringBuilder updatedMsg = new StringBuilder("<b>");
            updatedMsg.append(text);
            updatedMsg.append("</b>");
            boldStr = updatedMsg.toString();
        }
        return boldStr;
    }
888604
public VisDialog text (String text) {
		if (skin == null)
			throw new IllegalStateException("This method may only be used if the dialog was constructed with a Skin.");
		return text(text, skin.get(LabelStyle.class));
	}
215178
@Expose
    public static String capitalize(final String text, final Locale locale)
    {
        return withinLocale(new Callable<String>()
        {
            public String call() throws Exception
            {
                return capitalize(text);
            }
        }, locale);
    }
93239
public void setTitle(String title, String textcolor) {
    this.title = title;
    if(titlecss == null) {
      titlecss = new CSSClass(this, "text");
      titlecss.setStatement(SVGConstants.CSS_TEXT_ANCHOR_PROPERTY, SVGConstants.CSS_MIDDLE_VALUE);
      titlecss.setStatement(SVGConstants.CSS_FILL_PROPERTY, textcolor);
      titlecss.setStatement(SVGConstants.CSS_FONT_SIZE_PROPERTY, .6 * h);
    }
  }
752989
public ParagraphBuilder styledSpan(final String text, final TextStyle ts) {
		final ParagraphElement paragraphElement = new Span(text, ts);
		this.paragraphElements.add(paragraphElement);
		return this;
	}
881530
public static String fromSnakeCaseToCamelCase(String text) {
    if (isNullOrEmpty(text)) {
      return text;
    }
    String[] array = text.split("_");
    if (array.length == 0) {
      return "";
    }
    StringBuilder result = new StringBuilder();
    result.append(array[0].toLowerCase());
    for (int i = 1; i < array.length; i++) {
      String s = capitalize(array[i].toLowerCase());
      result.append(s);
    }
    return result.toString();
  }
608787
public T text(CharSequence text, boolean goneIfEmpty) {

        if (goneIfEmpty && (text == null || text.length() == 0)) {
            return gone();
        } else {
            return text(text);
        }
    }
451224
private String normalizeText(String text) {
        String[] tokens = StringUtils.split(text, "\n");
        for (int i = 0; i < tokens.length; i++) {
            tokens[i] = tokens[i].trim();
        }

        return StringUtils.join(tokens, " ").trim();
    }
1100044
def _capitalize_word(text, pos):
    """"""
    while pos < len(text) and not text[pos].isalnum():
        pos += 1
    if pos < len(text):
        text = text[:pos] + text[pos].upper() + text[pos + 1:]
    while pos < len(text) and text[pos].isalnum():
        pos += 1
    return text, pos
1342923
public Document literal(String text) {
        try {
            return parseString(text);        
        } catch (SAXException e) {
            throw new RuntimeException(text, e);
        }
    }
691218
public static String capitalize(String s) {
		if (s == null || isEmpty(s)) {
			return s;
		}
		return (new StringBuilder(s.length())).append(Character.toTitleCase(s.charAt(0))).append(s.substring(1)).toString();
	}
453120
public static String asTitleCase(String text) {
        // special for _value, eg we want to let underscore be like a space
        text = text.replace('_', ' ');

        // remove double spaces
        text = text.replaceAll("\\s+", " ");

        // see: http://stackoverflow.com/questions/2559759/how-do-i-convert-camelcase-into-human-readable-names-in-java
        text = text.replaceAll(
                String.format("%s|%s|%s",
                        "(?<=[A-Z])(?=[A-Z][a-z])",
                        "(?<=[^A-Z])(?=[A-Z])",
                        "(?<=[A-Za-z])(?=[^A-Za-z])"
                ),
                " "
        );

        return Character.toUpperCase(text.charAt(0)) + text.substring(1);
    }