@PublicEvolving public final class StringValueUtils extends Object
All methods in this class are written to be optimized for efficiency and work directly on the StringValues char arrays, avoiding copies. For simplicity and efficiency, the methods only apply to strings whose characters are representable in a single char, ie. strings without surrogate characters.
|Modifier and Type||Class and Description|
A tokenizer for string values that uses whitespace characters as token delimiters.
|Modifier and Type||Method and Description|
Replaces all non-word characters in a string by a given character.
Converts the given
public static void toLowerCase(StringValue string)
StringValueinto a lower case variant.
string- The string to convert to lower case.
public static void replaceNonWordChars(StringValue string, char replacement)
Character.isDigit(char), as well as the underscore character.
This operation is intended to simplify strings for counting distinct words.
string- The string value to have the non-word characters replaced.
replacement- The character to use as the replacement.
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.