Jump to content

Recommended Posts

Posted

Boa noite, alguém me sabe dizer como usar o String.split para expressoes que quero partir pelo simbolo=?

Basta String.split("=") ou terá de ser String.split("\\=")?

Posted

Não é por nada, mas... demoraste 38 minutos a ter uma resposta à tua pergunta quando podias ter feito um teste simples em 30 segundos:

class Untitled {
   public static void main(String[] args) {
       String test = "hello=world=!";

       String splitted[] = test.split("=");

       for (String s : splitted)
           System.out.println(s);
   }
}

“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”

-- Tony Hoare

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.