mardi 1 décembre 2015

Porblem with the html-Praser JSoup for Java [duplicate]

This question already has an answer here:

Why does the following Code-output is everytime "false"?

public static void main(String[] args) {

        Document doc;
        String c = "123456";
        boolean t = false;
        try {

            // need http protocol
            doc = Jsoup.connect("http://ift.tt/1XvfAUE").get();
             b = doc.toString(); 
             b = b.replaceAll(" ", "");
             b = b.substring(28,34);
             System.out.print(b);

             if(b == c){
                 t=true;
             }

                System.out.println(t);
        }

Aucun commentaire:

Enregistrer un commentaire