migrate type of invalidChars from List<String> to char[]