Simple replacement

Report a typo

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.

Enter a short text
___

Create a free account to access the full topic