Eve
Eve

Reputation: 514

Java hyperlink readtext

I'm trying to read the name from a hyperlink and use the name to compare with another for verification.

EDIT: This is what i currently have

String linkText = ####;

    for(int i = 0; i < objs.length; i++) {

        ArrayList<String> options = new ArrayList<String>();
        options.add("nameLink");
        options.add("nameLink");
        options.add("nameLink");
        options.add("nameLink");
        options.add("nameLink");

        if (options.contains(linkText))

What i want is to get the name of the hyperlink ALink = www.link.com so i want ALINK to be sent to linkText to compare if the name is the same.

Upvotes: 0

Views: 68

Answers (1)

Richard Hall
Richard Hall

Reputation: 21

If you meant that you have two URL's, then you can use the URL.toString() method, and then compare the two Strings using String.equals().

Upvotes: 2

Related Questions