Question d’entretien chez Agoda

Write a function to filter alphanumeric characters from string. How would you test it? Why you didn't use regular expression?

Réponses aux questions d'entretien

Utilisateur anonyme

24 janv. 2017

I created a simple function which keeps check on ASCII values for each character to filter it out.

Utilisateur anonyme

24 janv. 2019

String s = "AZabc1253.6789/'[paz`!@#$%^&*()"; String filter = s.replaceAll("[^0-9a-zA-Z_]", ""); System.out.print(filter);