'How to check if the parameter's value of a url contains a specified text [duplicate]

Is there a way to check that a parameter's value of a url contains a specified text. Let's suppose: Specified text=Rukhmani https://gorest.co.in/public/v2/users?name=Rukhmani This is my url and I want to check that 'name' Parameter has Rukhmani

Example 2: Here specified text is Rani https://gorest.co.in/public/v2/users?name=Rukhmani But the name parameter doesn't have Rani.

Please use Java only.



Solution 1:[1]

String text = "https://gorest.co.in/public/v2/users?name=Rukhmani";

    if(text.contains("Rukhmani")){
        System.out.println("true");
    }else{
        System.out.println("false");
    }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nihat