0

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.

1 Answers1

0

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

    if(text.contains("Rukhmani")){
        System.out.println("true");
    }else{
        System.out.println("false");
    }
Nihat
  • 19
  • 3
  • Here contains() will check for Rukhmani all over the string. But I just want to check if only 'name' parameter has Rukhmani. – NoobinPython3 Apr 26 '22 at 06:49