com.ihr.xbrl.util

## Class TextTools

- java.lang.Object
- - com.ihr.xbrl.util.TextTools

-     public class TextTools
      extends java.lang.Object

  The Class TextTools.
  Author:
    Ignacio

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String[]` | `resources` The Constant resources.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextTools()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addAfterSpacer(java.lang.StringBuffer sb, java.lang.String string, java.lang.String spacer)` Adds the after spacer.
    `static java.lang.String` | `getSignAndDigits(java.lang.CharSequence cs)` Returns the optional minus sign and all digits from the left of the incoming CharSequence and ignores other characters that are not digits.
    `static java.lang.String` | `htmlToText(java.lang.String inputHTML)` Very simple transformation between HTML and Text.
    `static java.lang.String` | `lowerFirstWord(java.lang.String inputStr)` Lower first word.
    `static java.lang.String` | `md5(java.lang.String source)` Compute md5 of the input text.
    `static java.lang.String` | `pluralize(java.lang.String text, double days)` Pluralize.
    `static java.lang.String` | `reencodeText(java.lang.String possibleHTMLtext)` Re encode a text string according with the rules defined in the EFM.
    `static java.lang.String` | `textToHTML(java.lang.String inputStr)` Very simple transformation of a text string with carrier returns into an HTML text with <br/> separators. 31/05/2012, now the encoding of < into &lt; and > into &gt; and & into &amp; is supported.
    `static java.lang.String` | `textToHTMLtext(java.lang.String string)` This is the surrounding method behind `textToHTML(String)`.
    `static java.lang.String` | `upperFirstLetter(java.lang.String string)` Simple text transformation to capitalize the first letter in the string.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### resources

          public static final java.lang.String[] resources

      The Constant resources.

  - ### Constructor Detail

    - #### TextTools

          public TextTools()

  - ### Method Detail

    - #### lowerFirstWord

          public static java.lang.String lowerFirstWord(java.lang.String inputStr)

      Lower first word.
      Parameters:
        `inputStr` - the input str
      Returns:
        the string

    - #### textToHTML

          public static java.lang.String textToHTML(java.lang.String inputStr)

      Very simple transformation of a text string with carrier returns into an HTML text with <br/> separators. 31/05/2012, now the encoding of < into &lt; and > into &gt; and & into &amp; is supported.
      Parameters:
        `inputStr` - input string as text.
      Returns:
        converted version of the input string

    - #### textToHTMLtext

          public static java.lang.String textToHTMLtext(java.lang.String string)

      This is the surrounding method behind `textToHTML(String)`.
      Parameters:
        `string` - the string
      Returns:
        the string
      See Also:
        `textToHTML(String)`

    - #### htmlToText

          public static java.lang.String htmlToText(java.lang.String inputHTML)

      Very simple transformation between HTML and Text. This method removes the markup and also removes styling etc.
      Parameters:
        `inputHTML` - the input html
      Returns:
        the string

    - #### upperFirstLetter

          public static java.lang.String upperFirstLetter(java.lang.String string)

      Simple text transformation to capitalize the first letter in the string.
      Parameters:
        `string` - the string
      Returns:
        the string

    - #### pluralize

          public static java.lang.String pluralize(java.lang.String text,
                                   double days)

      Pluralize.
      Parameters:
        `text` - the text
        `days` - the days
      Returns:
        the string

    - #### addAfterSpacer

          public static void addAfterSpacer(java.lang.StringBuffer sb,
                            java.lang.String string,
                            java.lang.String spacer)

      Adds the after spacer.
      Parameters:
        `sb` - the sb
        `string` - the string
        `spacer` - the spacer

    - #### getSignAndDigits

          public static java.lang.String getSignAndDigits(java.lang.CharSequence cs)

      Returns the optional minus sign and all digits from the left of the incoming CharSequence and ignores other characters that are not digits.
      Parameters:
        `cs` - the cs
      Returns:
        the sign and digits

    - #### reencodeText

          public static java.lang.String reencodeText(java.lang.String possibleHTMLtext)

      Re encode a text string according with the rules defined in the EFM. Search for a '<' sign, followed by a QName, optional white space and > sign. Extra '<' signs are encoded as %lt;
      Parameters:
        `possibleHTMLtext` - the possible htm ltext
      Returns:
        the string

    - #### md5

          public static java.lang.String md5(java.lang.String source)

      Compute md5 of the input text. If the input text is null it is considered as the empty string.
      Parameters:
        `source` - the input text
      Returns:
        a string representation of the MD5 digest such as 78e73127d8fd5ed64234b7c9a63b3