I have a requirement where I need to remove unwanted characters for String in java. For example, Input String is
Income ......................4,456
liability........................56,445.99
I want the output as
Income 4,456
liability 56,445.99
What is the best approach to write this in java. I am parsing large documents for this hence it should be performance optimized.