Stringutil Package FunctionStringutil Package function
First, the array is converted into a string:
1, stringutil.convstring (string[] str) converts the characters in the array to a string
STRING[3] s = {"A", "B", "C"}
Stringutil.convstring (s) = "A,b,c"
2. Static public string converstring (string[] str, string splitstr) converts characters in an array to a string to specify character segmentation
STRING[3] s = {"A", "B", "C"};
Stringutil.convstring (S, "@") = "a@b@c";
Two, the null value detection:
3. Stringutils.isempty (string str) determines whether a string is empty and the space is not null-treated. Stringutils.isempty (NULL) = True Stringutils.isempty ("") = True Stringutils.isempty ("") = False Stringutils.isempty (" Bob ") = False Stringutils.isempty (" Bob ") = False
4. public static Boolean IsBlank (String str) determines whether a string is empty and the space is null-treated. Stringutils.isnotblank (NULL) = True Stringutils.isblank ("") = True Stringutils.isblank ("") = True Stringutils.isblank (" Bob ") = False Stringutils.isblank (" Bob ") = False
Iii. non-null processing:
5, Stringutils.isnotempty (String str) to determine whether a string is not empty, the space is not NULL processing. Stringutils.isnotempty (NULL) = False Stringutils.isnotempty ("") = False Stringutils.isnotempty ("") = True stringutils. Isnotempty ("Bob") = True Stringutils.isnotempty ("Bob") = True
6. public static Boolean Isnotblank (String str) determines whether a string is not empty and the space is null-treated. Stringutils.isnotblank (NULL) = False Stringutils.isnotblank ("") = False Stringutils.isnotblank ("") = False stringutils . Isnotblank ("Bob") = True Stringutils.isnotblank ("Bob") = True
Four, space processing
7. public static string trim (string str) formats a space in a string, has a non-null judgment processing stringutils.trim (NULL) = null Stringutils.trim ("") = "" Stringutils.trim ("") = "" Stringutils.trim ("abc") = "abc" Stringutils.trim ("abc") = "abc"
8. public static string Trimtonull (String str)
Formats a space in a string that has non-null judgment processing if NULL stringutils.trimtonull (NULL) = null stringutils.trimtonull ("") = null Stringutils.trimtonull ("") = null stringutils.trimtonull ("abc") = "abc" Stringutils.trimtonull ("abc") = "abc"
9. public static string Trimtoempty (String str) formats a space in a string, has non-null judgment processing, and if NULL returns "" Stringutils.trimtoempty (NULL) = "" String Utils.trimtoempty ("") = "" Stringutils.trimtoempty ("") = "" Stringutils.trimtoempty ("abc") = "abc" Stringutils.trimtoe Mpty ("abc") = "abc"
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.