then find the exact matching string in a array of data and replace the exact match content.
What is a coding
matched with user input and it is replaced by space. So it just return
What is a
as a final result.
Piet Souris wrote:
Atul More wrote:(...)
This code return me "What is a", which is expected.
Are you sure? I do not expect this outcome.
Put some .peek(System.out::println) in your code, so that you can follow what Strings survive the filter and how they are changed.