What is the best way to approach translating this code into Java?
(the section called Convert Alpha-numeric Phone Number to All Numeric)
http://lawrence.ecorp.net/inet/samples/regexp-format.php
Since Java doesn’t have a lambda yet… what is the best approach for the String.replace ?
Wow, the original code is a bit over-verbose. I’d do:
And consequently in Java, something like:
Replacing with Java’s Matcher is clumsy enough that you might just prefer to use an array for this case: