1. Finishing
The Java string.length () method Usage Example tutorial returns the length of this string. The length is equal to the number of strings in the Unicode code unit, and the method declares public int length (). Parameter na. Returns the length of the sequence of characters represented by the object returned by this method.
The Java.lang.String.valueOf (char[] data) method returns the string representation of a char array parameter. The contents of the character array are copied and subsequent changes to the character array do not affect the newly created string. Parameter data. The return value of the method returns a newly allocated string that represents the same character sequence that contains the character array parameter.
Java string.replace () method Usage Example tutorial, returns a new string with Newchar to replace all occurrences of oldchar in this string.
The Java.lang.String.toUpperCase () method uses the default locale rule to capitalize all characters in this string.
The java.lang.String.toLowerCase (locale locale) method converts all the characters in this string to lowercase rules given by the locale:
The Java.lang.String.trim () method returns a copy of the string and ignores (removes) whitespace at the beginning and end.
The Java.lang.String.toCharArray () method converts the string into a new character array.
2. String encryption
Design ideas: Use Charat to implement string encryption.
Fourth after-school assignments