Last active
December 12, 2016 14:08
-
-
Save loiane/4ac11a49e1d64d5dfbcafb5d7f2e1b3e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
System.out.println(numero); | |
String[] dados = {"abc", "def", "99 "}; | |
numero = Long.parseLong(dados[2].replaceAll(" ", "")); | |
System.out.println(numero); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment