Oi, estou tentando aprender java e gostaria de encontrar palindromes em um arquivo ignorando strings que contenham numeros. Se o nome do arquivo nao for fornecido, imprimir “argumentos insuficientes”. Se nao houver arquivo, imprimir “Arquivo nao encontrado”
Tentei:
public class PalindromeCounter {
public static void main(String[] args) {
File infile = new File(args[0]);
try {
Scanner scan = new Scanner(infile);
// need to step through the file to see its length
while(scan.hasNextLine()) {
String line = scan.nextLine();
Scanner lineScan = new Scanner(line);
Mas como transformar o lineScan em String para testar se e um palindrome ou nao?
Obrigada