mardi 9 avril 2019

How do I check if a string starts with a letter?

I need to add words to a list, but only if the word starts with a letter. How do I go about writing a conditional statement to check this?

        while (sc.hasNext()) {
            if (sc.next.startsWith(??)
            wordList.add(sc.next());    
        }

Aucun commentaire:

Enregistrer un commentaire