Check if the string only contains number and the specified separator characters.
Removes empty spaces and any additional specified characters.