[Guava Study Notes] Strings: string processing, guavastrings
My technical blog is often maliciously crawled and reproduced by rogue websites. Please move to the original article: Workshop.
Joiner
Joiner joiner = Joiner.on("; ").skipNulls();return joiner.join("Harry", null, "Ron", "Hermione");
You can also. join (List)
Splitter
Splitter.on(',') .trimResults() .omitEmptyStrings() .split("foo,bar,, qux");
Can be on (CharMatcher), on (Pattern)FixedLength (int) is split into fixed lengths.
AvailableLimit (int) modifier to limit the number of returned results.
CharMatcher
Constant:ANYNONE WHITESPACEBREAKING_WHITESPACEDIGIT numbersJAVA_LETTER_OR_DIGITJAVA_LOWER_CASE lower case
Given: anyOf ("abcde ")Is (char)InRange ('A', 'z ')
Operation:Negate () inversionAnd (CharMatcher)AndOr (CharMatcher) Get or
CollapseFrom (CharSequence, char) is continuously replaced with a singleRemoveFrom (CharSequence)RetainFrom (CharSequence) only retains these items, and all others are removed.ReplaceFrom (CharSequence, CharSequence)
Charsets. UTF_8
How many days does it take for QQ to ascend from one sun to two?
The formula is: D = the square of R + 4 multiplied by R (D is the number of days, R is the level)
According to this formula, it is not difficult to calculate that it takes 832 days from one sun to two suns ~
So, please wait ~ No, just wait two more years.
By the way, the sun is 320 days, the sun is 1152 days, and the sun is 2496 days ~