File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/main/java/com/booleanuk/extension Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public StringBuilder one() {
29
29
// 1. Using the sb variable above, add "Hello, world!" to the StringBuilder
30
30
// WRITE YOUR CODE BETWEEN THIS LINE...
31
31
32
-
32
+ sb . append ( "Hello, world!" );
33
33
34
34
// ...AND THIS LINE
35
35
@@ -43,7 +43,8 @@ public StringBuilder two() {
43
43
// 2. After adding the message, use an appropriate StringBuilder method to reverse it
44
44
// WRITE YOUR CODE BETWEEN THIS LINE...
45
45
46
-
46
+ sb .append ("Hello, world!" );
47
+ sb .reverse ();
47
48
48
49
// ...AND THIS LINE
49
50
@@ -57,7 +58,8 @@ public StringBuilder three() {
57
58
// 2. After adding the message, remove the comma.
58
59
// WRITE YOUR CODE BETWEEN THIS LINE...
59
60
60
-
61
+ sb .append ("Hello, world!" );
62
+ sb .deleteCharAt (5 );
61
63
62
64
// ...AND THIS LINE
63
65
@@ -71,7 +73,8 @@ public StringBuilder four() {
71
73
// 2. After adding the message, replace the word "world" with the word "Java"
72
74
// WRITE YOUR CODE BETWEEN THIS LINE...
73
75
74
-
76
+ sb .append ("Hello, world!" );
77
+ sb .replace (7 , 12 , "Java" );
75
78
76
79
// ...AND THIS LINE
77
80
You can’t perform that action at this time.
0 commit comments