Package com.vaadin.flow.internal
Class StringUtil
java.lang.Object
com.vaadin.flow.internal.StringUtil
Utility class for special string handling.
For internal use only. May be renamed or removed in a future release.
- Since:
- 2.1.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringGenerate a hash for given content.static StringGenerate hash for content using given charset for string byte encoding.static StringremoveComments(String code) Removes comments (block comments and line comments) from the JS code.static StringremoveComments(String code, boolean useStringApostrophe) Removes comments (block comments and line comments) from the JS code.
-
Constructor Details
-
StringUtil
public StringUtil()
-
-
Method Details
-
removeComments
Removes comments (block comments and line comments) from the JS code.- Parameters:
code- code to clean comments from- Returns:
- the code with removed comments
-
removeComments
Removes comments (block comments and line comments) from the JS code.- Parameters:
code- code to clean comments fromuseStringApostrophe- iftruethen ' is also considered a string and comments will not be considered inside it- Returns:
- the code with removed comments
-
getHash
Generate a hash for given content.- Parameters:
content- content to generate hash for- Returns:
- hash String for given content. In case content is null or empty returns empty String.
-
getHash
Generate hash for content using given charset for string byte encoding.- Parameters:
content- content to hashcharset- charset for encoding- Returns:
- hash String for given content. In case content is null or empty * returns empty String.
-