Skip to content

Instantly share code, notes, and snippets.

@hdelei
Last active August 19, 2023 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hdelei/0bbff7d8d37c718d8ab6023f568a5161 to your computer and use it in GitHub Desktop.
Save hdelei/0bbff7d8d37c718d8ab6023f568a5161 to your computer and use it in GitHub Desktop.
import java.util.ArrayList;
class HelloWorld {
public static void main(String[] args) {
ArrayList<String[]> linhas = new ArrayList<>();
//aqui fica dentro do WHILE =======
String textoLinha = "vanderlei;alice;isa";
String[] linhaQuebrada = textoLinha.split(";");
linhas.add(linhaQuebrada);
//==============
//aqui eh soh pra imprimir e ver o resultado
System.out.println("coluna 1: " + linhaQuebrada[0]);
System.out.println("coluna 2: " + linhaQuebrada[1]);
System.out.println("coluna 3: " + linhaQuebrada[2]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment