October 2017
Beginner
318 pages
7h 26m
English
A lot of the methods you'll see in the methods list are pretty self-explanatory (toLowerCase(), toUpperCase(), and so on). But just to make sure we're all on the same page, let's make use of one of them. Let's use replace(). The replace() function takes two arguments, and these arguments can either be single characters or a character sequence of which a string qualifies. This method simply replaces all the instances of the first string or character with the second string or character. Let's look at the following replace() example:
package strings;
public class Strings {
public static void main(String[] args) {
String s1 = new String ("Strings are arrays of characters");
String s2 = new String ("Strings are arrays of ...Read now
Unlock full access