There is an encoded URL. After decoding

String decodedURL = URLDecoder.decode(encodedLink, "UTF-8"); String delims = "[u, &]"; String[] splittedURL = decodedURL.split(delims); String resultURL = splittedURL[1].substring(1); 

I get the following URL:

 http://example.com?I=vNjWAwAAAABfva85AgAAAABR%2Fv%2F%2F%2FwD%2F%2F%2F%2F%2FBGNhdnMA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8%3D 

But in this part:

 %2Fv%2F%2F%2FwD%2F%2F%2F%2F%2FBGNhdnMA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8%3D 

I need the "F" and "D" letters to be in Lowercase: (F -> f, D -> d). Is it possible to do this by decoding without a split of the url, followed by replacing capital letters with lowercase letters by:

 .toLowerCase(); 

?

  • Great! But I need to practice in English) - Kiryl Parkhomenka
  • Welcome to StackOverflow in English! As the name implies, this site. Please either translate the question in English . If you choose to translate it. - Mikhail Vaysman
  • Thank you, Michael) Done! - Kiryl Parkhomenka
  • why do you need it? The standard recommends using BIG letters. - Mikhail Vaysman
  • I need to compare the initial URL and this decoded URL in AutoTest. In the initial URL, the letters f are lowercase. The test falls. - Kiryl Parkhomenka

1 answer 1

Use the string equalsIgnoreCase(anotherString) function to compare.

  • Not exactly what is needed, because Links are compared by the composer. - Kiryl Parkhomenka