Scripting languages like Perl or my old favorite REXX are well suited to string handling. Java will do perfectly well, though, and if it's your goal to get better at Java any little task like that will be good practice.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi