Class WbsStrings

java.lang.Object
wbs.utils.util.string.WbsStrings

public final class WbsStrings extends Object
  • Method Details

    • capitalizeAll

      public static String capitalizeAll(String str)
      Capitalize all words in a string, separated by spaces
      Parameters:
      str - The string to process
      Returns:
      The string with all words capitalized
    • capitalize

      public static String capitalize(@NotNull @NotNull String str)
      Capitalize the first letter a string
      Parameters:
      str - The string to capitalize
      Returns:
      The capitalized string
    • getLineWith

      public static String getLineWith(String find, Collection<String> in)
      Get the first string in a Collection that contains another string.
      Parameters:
      find - The string to find
      in - The Collection to search for the string in
      Returns:
      The full string that contains the find parameter. null if the Collection does not contain a string that contains find.
    • getInvisibleString

      public static String getInvisibleString(String original)
      Get a string that, when rendered in minecraft, will be invisible.
      Parameters:
      original - The string to hide
      Returns:
      The string that will render invisibly in game.
    • colourise

      public static String colourise(String string)
    • revealString

      public static String revealString(String invisibleString)
      Reveal a string concealed by getInvisibleString(String)
      Parameters:
      invisibleString - An "invisible" string created by getInvisibleString(String)
      Returns:
      The original string
    • combineLast

      public static String combineLast(String[] strings, int index)
      Combine the final elements of a string array starting at a specified index
      Parameters:
      strings - The array of Strings to combine
      index - The index to start combining at
      Returns:
      A single String containing all entries in {strings} split with " ", excluding the first {index} entries
    • combineLast

      public static String combineLast(String[] strings, int index, String delimiter)
    • getNextNodes

      public static Set<String> getNextNodes(String current, Collection<String> options)
    • getNextNodes

      public static Set<String> getNextNodes(String current, Collection<String> options, String delimiter)
    • combineFirst

      public static String combineFirst(String[] strings, int length)
    • combineFirst

      public static String combineFirst(String[] strings, int length, String delimiter)
    • undoColourText

      public static String undoColourText(String colouredText)
    • addColourGradient

      public static String addColourGradient(String string, org.bukkit.Color startColour, org.bukkit.Color endColour)
    • addColourGradient

      public static String addColourGradient(String string, org.bukkit.Color startColour, org.bukkit.Color endColour, boolean colourise)
    • filterStartsWith

      public static List<String> filterStartsWith(Collection<String> choices, String filter)
      Filter a collection of strings by those that start with the given string
      Parameters:
      choices - The collection to filter
      filter - The string to check startsWith
      Returns:
      A list of strings that contains only elements of choices that start with the filter string, ignoring case