String: How to replace multiple possible characters with a single character?
String new_s = s.toLowerCase().replaceAll("[ .]", "_");
EDIT:
replaceAll
is using regular expressions, and using .
inside a character class [ ]
just recognises a .
rather than any character.
s.replaceAll("[\\s\\.]", "_")