Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class TesteStringInteger {
public static void main(String[] args) {
String numeroDoArquivo = "99 ";
//numeroDoArquivo = numeroDoArquivo.trim(); //remove espaços das extremidades
numeroDoArquivo = numeroDoArquivo.replaceAll(" ", ""); //remove todos os espaços
long numero = Long.parseLong(numeroDoArquivo);
String[] dados = {"abc", "def", "99 "};
numero = Long.parseLong(dados[2].replaceAll(" ", ""));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.