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 Summary
Modifier and Type Method Description static boolean
atLeastOneNonEmptyStr(List<String> list)
Checks if there is any non-empty string in a list.static String
reverse(String str)
Returns a new string, whose characters appear in reverse order.static List<String>
reverseStringsInList(List<String> list)
Reverse every string in a list, but do not change the order of elements in the list.static Set<String>
reverseStringsInSet(Set<String> set)
Reverse every string in a set.
-
Method Details
-
reverseStringsInList
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
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
Returns a new string, whose characters appear in reverse order.- Parameters:
str
- input-string- Returns:
- a new string with characters in reverse order
-
atLeastOneNonEmptyStr
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
-