/*3. Judging
* 3.1 Two string content is the same?
* Boolean equals (Object obj) (the argument is an object, not a string, because Equals is the Equals method that overrides object, what is the argument of the parent class, and what argument does the equals have?)
* Boolean equalsignorecase (String str) compares this string to another string, regardless of the case.
*
* 3.2 Does the string contain the specified string?
* Boolean contains (Charsequence s) returns True when and only if this string contains a sequence of specified char values.
*
* 3.3 Does the string begin with the specified string? Do you want to end with the specified string?
* Boolean startsWith (string prefix) tests whether this string starts with the specified prefix.
* EndsWith (string suffix) tests whether this string ends with the specified suffix.
* */
public static void Main (string[] args) {
3.1
String s= "ABC";
System.out.println (S.equals ("ABC". toUpperCase ()));//false
System.out.println (S.equalsignorecase ("ABC")),//true,equalsignorecase (""), this method ignores case and determines whether the contents of the string are the same
3.2
System.out.println (S.contains ("a"));//true,s contains A,
3.3
String str= "Arraydamo.java";
System.out.println (Str.startswith ("Arraydamo"));//I want to find all the files that start with Arraydamo.
System.out.println (Str.endswith (". Java"));//I want to find all the files that end in. java.
System.out.println (Str.contains ("Damo"));//I want to find a file that contains Damo characters
}
Object-oriented 15.3String class-common functions-judging