Class Strings

java.lang.Object
joptsimple.internal.Strings

public final class Strings extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Tells whether the given string is either or consists solely of whitespace characters.
    static String
    join(Iterable<String> pieces, String separator)
    Gives a string consisting of the string representations of the elements of a given array of objects, each separated by a given separator string.
    static String
    join(String[] pieces, String separator)
    Gives a string consisting of the elements of a given array of strings, each separated by a given separator string.
    static String
    repeat(char ch, int count)
    Gives a string consisting of the given character repeated the given number of times.
    static String
    surround(String target, char begin, char end)
    Gives a string consisting of a given string prepended and appended with surrounding characters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Strings

      private Strings()
  • Method Details

    • repeat

      public static String repeat(char ch, int count)
      Gives a string consisting of the given character repeated the given number of times.
      Parameters:
      ch - the character to repeat
      count - how many times to repeat the character
      Returns:
      the resultant string
    • isNullOrEmpty

      public static boolean isNullOrEmpty(String target)
      Tells whether the given string is either or consists solely of whitespace characters.
      Parameters:
      target - string to check
      Returns:
      true if the target string is null or empty
    • surround

      public static String surround(String target, char begin, char end)
      Gives a string consisting of a given string prepended and appended with surrounding characters.
      Parameters:
      target - a string
      begin - character to prepend
      end - character to append
      Returns:
      the surrounded string
    • join

      public static String join(String[] pieces, String separator)
      Gives a string consisting of the elements of a given array of strings, each separated by a given separator string.
      Parameters:
      pieces - the strings to join
      separator - the separator
      Returns:
      the joined string
    • join

      public static String join(Iterable<String> pieces, String separator)
      Gives a string consisting of the string representations of the elements of a given array of objects, each separated by a given separator string.
      Parameters:
      pieces - the elements whose string representations are to be joined
      separator - the separator
      Returns:
      the joined string