Class StringUtilities

Object
com.owenfeehan.pathpatternfinder.patternelements.StringUtilities

public class StringUtilities
extends Object
Utilities functions to help with reversing strings and other string operations.
Author:
Owen Feehan
  • Method Details

    • reverseStringsInList

      public static List<String> reverseStringsInList​(List<String> list)
      Reverse every string in a list, but do not change the order of elements in the list.
      Parameters:
      list - input-list
      Returns:
      a new list with the reversed-strings as elements (in identical order as the input)
    • reverseStringsInSet

      public static Set<String> reverseStringsInSet​(Set<String> set)
      Reverse every string in a set.
      Parameters:
      set - input-set
      Returns:
      a new set with the reversed-strings as elements (in identical order as the input)
    • reverse

      public static String reverse​(String str)
      Returns a new string, whose characters appear in reverse order.
      Parameters:
      str - input-string
      Returns:
      a new string with characters in reverse order
    • atLeastOneNonEmptyStr

      public static boolean atLeastOneNonEmptyStr​(List<String> list)
      Checks if there is any non-empty string in a list.
      Parameters:
      list - input-list
      Returns:
      true iff there's at least one non-empty string