public class StringSplitUtils extends Object
Stringmanipulation methods. Copied from deleted org.springframework.security.util.StringSplitUtils
|Constructor and Description|
|Modifier and Type||Method and Description|
Takes an array of
Splits a given string on the given separator character, skips the contents of quoted substrings when looking for separators.
Stringat the first instance of the delimiter.
Does not include the delimiter in the response.
toSplit- the string to split
delimiter- to split the string up with
IllegalArgumentException- if an argument was invalid
public static Map<String,String> splitEachArrayElementAndCreateMap(String array, String delimiter, String removeCharacters)
Strings, and for each element removes any instances of
removeCharacter, and splits the element based on the
Mapis then generated, with the left of the delimiter providing the key, and the right of the delimiter providing the value.
Will trim both the key and value before adding to the
array- the array to process
delimiter- to split each element using (typically the equals symbol)
removeCharacters- one or more characters to remove from each element prior to attempting the split operation (typically the quotation mark symbol) or
nullif no removal should occur
Maprepresenting the array contents, or
nullif the array to process was null or empty
Copyright © 2014. All rights reserved.