Look at the following code:
String text = "pentagon... a pentagon contains 3 triangles";
text.replaceFirst("\\bpentagon\\b", "hexagon");
System.out.println(text);
Write the text that will be displayed on the screen.
Look at the following code:
String text = "pentagon... a pentagon contains 3 triangles";
text.replaceFirst("\\bpentagon\\b", "hexagon");
System.out.println(text);
Write the text that will be displayed on the screen.
Create a free account to access the full topic