StringUtils
class StringUtils
StringUtils contains a set of static methods to operate with strings, needed to serialize/normalize person names, titles, years and so on.
Constants
WHITE_SPACE |
|
AT_LEAST_TWO_WHITE_SPACES |
|
SINGLE_NUMBER |
|
FOUR_NUMBERS |
|
NON_NUMBERS |
|
NON_NUMBERS_OR_LETTERS |
|
NON_NUMBERS_OR_LETTERS_OR_DOTS_OR_SPACE |
|
NON_NUMBERS_OR_LETTERS_OR_DOTS_OR_COMMA_OR_SPACE |
|
NON_LETTERS_OR_DOTS_OR_COMMA_OR_SEMICOLON_OR_SPACE |
|
TITLE_SOURCE_SPLIT_PATTERN |
|
DEFAULT_CHARSET |
|
PARSE_MODE_KEY |
|
PARSE_MODE_VALUE |
|
Methods
Removes everything which is neither a number nor a letter.
Removes everything, but numbers.
All strings in the array are concatenated and returned as one single
string, i.e. like [item1,item2,item3,.
No description
No description
Removes everything which is neither a number nor a letter nor a dot (.) nor a comma nor nor space.
Removes everything which is neither a letter nor a dot (.) nor a comma nor a semicolon nor white space.
two or more spaces in a row will be replaced by a single space character.
decodes html entities, removes tags, converts to utf8 and removes double, triple (a.s.o.) white spaces
No description
Returns the year from an string containing substring like: JAN 19, 2013
Extracts four digits (year) from a string.
No description
No description
No description
No description
No description
No description
Converts an array of objects to an array of strings.
No description
No description
No description
No description
Details
at line 73
static string
removeNonNumbersOrLetters(string $string)
Removes everything which is neither a number nor a letter.
at line 84
static string
removeNonNumbers(string $string)
Removes everything, but numbers.
at line 98
static string,
getStringFromList(array|ArrayList $array)
All strings in the array are concatenated and returned as one single
string, i.e. like [item1,item2,item3,.
..].
at line 107
static
removeNonNumbersOrLettersOrDotsOrSpace($string)
at line 113
static
normalizeWhitespace($string)
at line 127
static string
removeNonNumbersOrLettersOrDotsOrCommaOrSpace(string $string)
Removes everything which is neither a number nor a letter nor a dot (.) nor a comma nor nor space.
Note: does not remove whitespace around the numbers!
at line 138
static string
removeNonLettersOrDotsOrCommaOrSemicolonOrSpace(string $string)
Removes everything which is neither a letter nor a dot (.) nor a comma nor a semicolon nor white space.
at line 149
static string
cleanTitle(string $title)
two or more spaces in a row will be replaced by a single space character.
at line 161
static string
cleanTitle2(string $title)
decodes html entities, removes tags, converts to utf8 and removes double, triple (a.s.o.) white spaces
at line 173
static array|boolean
split(string $string, string $pattern)
at line 183
static string
extractDateYearFromTitleSource(string $titleSource)
Returns the year from an string containing substring like: JAN 19, 2013
at line 199
static string
extractYear(string $string)
Extracts four digits (year) from a string.
If a year pattern will be found it returns them, otherwise an empty string.
at line 215
static array
splitTitleSource(string $titleSource)
at line 228
static string
extractJournalTitle(string $titleSource)
at line 238
static string
extractYearFromTitleSource(string $titleSource)
at line 249
static string
extractVolume(string $titleSource)
at line 259
static string
extractIssue(string $titleSource)
at line 269
static string
extractPage(string $titleSource)
at line 282
static array
toStringArray(array $array)
Converts an array of objects to an array of strings.
ATTENTION: The __toString() method has to be implemented in ALL objects, which the array contains.