The following constructor methods and some common methods for the string class are:
/* Strings: A string of data consisting of multiple characters. It can also be seen as a character array. * By looking at the API, you know that * A: the string literal "abc" can also be seen as a string object. * B: The string is a constant, and once assigned, it cannot be changed. * * Construction Method: * public string (): Empty construct *public string (byte[] bytes): Convert byte array to string *public strings (byte[] Bytes,int Index,int Leng TH): Convert a portion of a byte array to a string *public string (char[] value): Convert the character array to a string, *public string (char[] Value,int index,int count): Turn a part of a character array into a string *public string (string original): The method of turning a string constant value into a string * * string: note (array is not the length method) * public int Length () : Returns the length of this string. */
/* * String class's judgment function: * Boolean equals (Object obj): Compares the contents of a string to the same, case-sensitive * Boolean equalsignorecase (String str): Compares the contents of a string Ignore Case * Boolean contains (String str): Determines whether a large string contains a small string * Boolean StartsWith (String str): Determines whether a string begins with a specified string * Boolean ENDSWI Th (String str): Determines whether the string ends with a specified string * Boolean IsEmpty (): Determines whether the string is an empty string. * * Note: * String contents are empty and string objects are empty. * String s = "";//boolean isEmpty (); Is the judge here, the contents of the empty string * string s = null;//This is empty, is the object is empty, there is no this object. */
Because the method of the string class is too much, the specific content and functionality can be viewed through the API documentation.
Here are a few small cases for the string class.
"First season of Java" and the like (the common methods for string classes are small)