Class TextUtil

java.lang.Object
com.spinyowl.legui.util.TextUtil

public class TextUtil extends Object
Text utility.
  • Method Details

    • findNextWord

      public static int findNextWord(String text, int current)
      Used to find next word start index from current character index in provided string.
      Parameters:
      text - string to search next word start index.
      current - current character index(current caret position in text).
      Returns:
      character index where starts next word.
    • findPrevWord

      public static int findPrevWord(String text, int current)
      Used to find previous word start index from current character index in provided string.
      Parameters:
      text - string to search previous word start index.
      current - current character index(current caret position in text).
      Returns:
      character index where starts previous word.
    • cpToStr

      public static String cpToStr(int cp)
      Used to convert character codepoint to string.
      Parameters:
      cp - codepoint.
      Returns:
      string from codepoint.