If I have a string like below :
String str = "Google is awesome search engine. https://www.google.co.in";
Now in the above string I need to check if the string contains any link or not. In the above string it should return true as the string contains a link.
The function should check www.google.com
also as link. It should not dependent on http://
or https://
I have checked this link also What's the best way to check if a String contains a URL in Java/Android? But it is returning true only if the string contain url only and what I want is if a string contain link at any place, it should return true.
I want that string also which will match the pattern, so that I can set that in a textview in android and can make it clickable.
How can I do this, please help me.