public class StrgUtils extends Object
Constructor and Description |
---|
StrgUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
compareVersion(String v1,
String v2)
compares the given version (v1) against another one (v2)
Special case: if we have SNAPSHOT or SVN version, and both are the same, return -1 |
static String |
convertToAscii(String input,
boolean replaceAllCapitalLetters)
This method takes an input String and replaces all special characters like umlauts, accented or other letter with diacritical marks with their
basic ascii equivalents.
|
static String |
getLongestString(String[] array) |
static String |
mapToString(Map map)
Map to string.
|
static Date |
parseDate(String dateAsString)
Parses the date.
|
static String |
removeCommonSortableName(String title)
Returns the common name of title/originaltitle when it is named sortable
eg "Bourne Legacy, The" -> "The Bourne Legacy". |
static String |
removeDuplicateWhitespace(String s)
Remove all duplicate whitespace characters and line terminators are replaced with a single space.
|
static String |
removeHtml(String html)
Removes the html.
|
static String |
substr(String str,
String pattern)
gets regular expression based substring.
|
static String |
unquote(String str)
Unquote.
|
static String |
zeroPad(String encodeString,
int padding)
Zero pad.
|
public static String removeHtml(String html)
html
- the htmlpublic static String unquote(String str)
str
- the strpublic static String mapToString(Map map)
map
- the mappublic static String zeroPad(String encodeString, int padding)
encodeString
- the encode stringpadding
- the paddingpublic static String substr(String str, String pattern)
str
- the string to searchpattern
- the pattern to match; with ONE group bracket ()public static Date parseDate(String dateAsString) throws ParseException
dateAsString
- the date as stringParseException
- the parse exceptionpublic static String removeDuplicateWhitespace(String s)
s
- a not null Stringpublic static String convertToAscii(String input, boolean replaceAllCapitalLetters)
input
- String to convertreplaceAllCapitalLetters
- true
causes uppercase special chars that are replaced by more than one character to be replaced by all-uppercase
replacements; false
will cause only the initial character of the replacements to be in uppercase and all subsequent
replacement characters will be in lowercase.public static String removeCommonSortableName(String title)
title
- the titlepublic static int compareVersion(String v1, String v2)
v1
- given versionv2
- other versionCopyright © 2012–2017 tinyMediaManager. All rights reserved.