Class TextUtils

java.lang.Object
ch.autumo.commons.utils.common.TextUtils

public class TextUtils extends Object
Text Utils.
  • Method Details

    • replaceVariable

      public static StringBuilder replaceVariable(StringBuilder input, String variable, String value)
      Replace a single variable.
      Parameters:
      input - source
      variable - variable
      value - value for replacement
      Returns:
      new replaced source
    • replaceVariable

      public static StringBuffer replaceVariable(StringBuffer input, String variable, String value)
      Replace a single variable.
      Parameters:
      input - source
      variable - variable
      value - value for replacement
      Returns:
      new replaced source
    • replaceAllCharacters

      public static String replaceAllCharacters(char newChar, String oldChars, String value)
      Replace all old chars with new char.
      Parameters:
      newChar - new character
      oldChars - all old chars toegether as one string
      value - value to char replace
      Returns:
      new char replaced value
    • replaceAllCharacters

      public static String[] replaceAllCharacters(char newChar, String oldChars, String[] values)
      Replace all old chars with new char in all strings in array.
      Parameters:
      newChar - new character
      oldChars - all old chars toegether as one string
      values - values to replace with char
      Returns:
      new char replaced values
    • escapeHtml

      public static String escapeHtml(String value)
      HTML escape value.
      Parameters:
      value - to escape
      Returns:
      value escaped value