Apache commons--stringutils

Source: Internet
Author: User

StringUtils is a string tool class, the Main method is as follows:

1, public static Boolean IsEmpty (Charsequence CS): Determine whether the string is "" or null,

Stringutils.isempty (NULL) = True
Stringutils.isempty ("") = True
Stringutils.isempty ("") = False
Stringutils.isempty ("Bob") = False
Stringutils.isempty ("Bob") = False

2. public static Boolean Isnotempty (Charsequence CS): Determines whether the string is not "" or is not NULL

Stringutils.isnotempty (NULL) = False
Stringutils.isnotempty ("") = False
Stringutils.isnotempty ("") = True
Stringutils.isnotempty ("Bob") = True
Stringutils.isnotempty ("Bob") = True

3, public static Boolean Isanyempty (Charsequence ... css): any one parameter is empty, return true, if these parameters are not empty then return false

Stringutils.isanyempty (NULL) = True
Stringutils.isanyempty (null, "foo") = True
Stringutils.isanyempty ("", "bar") = True
Stringutils.isanyempty ("Bob", "") = True
Stringutils.isanyempty ("Bob", NULL) = True
Stringutils.isanyempty ("", "bar") = False
Stringutils.isanyempty ("foo", "bar") = False

4, public static Boolean Isnoneempty (Charsequence ... css): Any parameter is empty, return false, all parameters are not empty, return true

Stringutils.isnoneempty (NULL) = False
Stringutils.isnoneempty (null, "foo") = False
Stringutils.isnoneempty ("", "bar") = False
Stringutils.isnoneempty ("Bob", "") = False
Stringutils.isnoneempty ("Bob", NULL) = False
Stringutils.isnoneempty ("", "bar") = True
Stringutils.isnoneempty ("foo", "bar") = True

5, public static Boolean IsBlank (Charsequence CS): Determine whether the character object is not an empty string

Stringutils.isblank (NULL) = True
Stringutils.isblank ("") = True
Stringutils.isblank ("") = True
Stringutils.isblank ("Bob") = False
Stringutils.isblank ("Bob") = False

6. public static Boolean Isnotblank (Charsequence CS): Determines whether the character object is not an empty string

7, public static Boolean Isanyblank (Charsequence ... css): Determine whether the string is an empty string, all empty strings will return true, otherwise return false

8, public static Boolean Isnoneblank (Charsequence ... css): Determine whether the string is not an empty string, all is not an empty string to return True, otherwise return false

9. public static string trim (String str): Removes whitespace from the end of the string

10. public static Boolean equals (Charsequence cs1, charsequence CS2): Determines whether strings are equal

11. public static Boolean equalsignorecase (Charsequence str1, Charsequence str2): string comparison, ignoring case

12. public static int indexOf (charsequence seq, int SearchChar): Returns the position index of the first occurrence of the string

13. public static int Ordinalindexof (Charsequence str, charsequence searchstr, int ordinal): Determines the index of the position where the string appears in the other string

14. public static int lastIndexOf (Charsequence seq,int SearchChar): The position index of the last occurrence of the character in the string

15, public static int lastordinalindexof (charsequence str,charsequence searchstr, int ordinal): Determines the index of the position where the character appears in the countdown to the string

16. public static Boolean contains (charsequence seq, int SearchChar): Determines if the character is in another string

17. public static string substring (String str,int start): String intercept

18. public static string left (String Str,int len): The number of characters to the ieft of a string

public static string right (string str, int len): How many characters to the left of a string

    

  

Apache commons--stringutils

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.