Skip to content

vsilverman/stringProblem

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

stringProblem

Define a Java class to solve this problem:
Given a String and a Character, remove all instances of the Character in the String

Solve this two ways:

  1. Iterate through the String, one character at a time
  2. Find a method in the String class that can solve this in one line

Write methods for each solution. Written Java class should have a main method, allowing to execute it without parameters (default execution) and with parameters. This class should allow accepting as parameters original string and a character to be removed.

Afterwards, write a TestNG or JUnit class for each solution which tests these methods.
Include both positive and negative cases for validations. All tests may be combined in a one or several test cases. Positive tests should include at least two words as original string. Negative tests should include at least the case when removable character is not part of original string, string with spaces only, empty string, null string.

Provide a screenshot showcasing results of executing JUnit tests for both methods.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%