how to use replaceall for string – Selenium and Java challenge 5

We have provided a Selenium with Java program below. These types of questions are common in the programming test rounds for Selenium automation testing.
Your task is to determine the output of the code. Click the Solution button below to view the answer. Your feedback, along with any comments, would be greatly appreciated.

import org.testng.annotations.Test;

public class SampleProgram5{

@Test
public void testMySkills() {
    System.out.println(printString());
}

public String printString() {
    String str = "Welcome to zesting zalks Lazesz";
    str = str.replaceAll("z","t");
    return str;
}

}

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Testingtalkslatest.com - A project by CreativeHub IT Solutions.
Contact Us At: support@testingtalkslatest.com
Our Partner websites - Classified Hub , CodesToolbox , Smart Fitness Guide , CodesToolbox , Testing Forum
Scroll to Top
0
Would love your thoughts, please comment.x
()
x