Learning java Road 4

Between trance has come to the end of July, the end of the week, time is always rush to leave, ranging from anyone.

Get to the bar.

This week learning the strings, as well as an array, the time spent four hours on the code, solve the three hours on the issue;

String:

First, some small knowledge

1, the connection string using the "+" operator, allows the connection of a plurality of strings;

2, Get string length str.length (); String str = "We are students"; int size = str.length ();

3, the search string return parameters for the first time to appear: str.indexOf (String s); return to the position last occurrence: str.lastIndexOf (substr)

4, to obtain the specified index character: str.charAt (int index)

5, acquires the returned string taken until the end of the string substring from a designated location: str.substring (int beginIndex); return from a start position to the end position of a substring: str.substring (int beginIndex, int endIndex);

6, the replacement string: str.replace (char oldChar, char newChar);

7, the start and end of the string is determined: Start str.startsWith (String prefix); end str.endsWith (String suffix);

8, string case conversion: lowercase str.toLowerCase (); converted to uppercase: str.toUpperCase ();

Some format string and the date, time, of a conventional type, regular expressions;

Learned a temporary array of one-dimensional, two-dimensional array creation and use, I believe I would not have said it, I am sure you will.

Road with the teacher to apologize, and I did not learn enough this week, only four days to learn, but I learned some feel not previously learned, very fulfilling.

Next week the completion of an array, then the classes and objects.

Guess you like

Origin www.cnblogs.com/022414ls/p/11257891.html