@ephemient can you please give me example I can't understand that sorry 😞
👍 1
z
Zun
01/29/2022, 10:03 AM
You can use regular expression to extract the link or some other tricks such as splitting the text and getting whichever item contains a link
j
Jiddles
01/29/2022, 10:41 AM
Example using ephemient's suggestion:
Copy code
val inputString = "Check out this property I found using Daft\n\n<https://www.daft.ie>"
val regex = Patterns.WEB_URL.toRegex()
// If there is matching string, then find method returns non-null MatchResult
val match = regex.find(inputString)!!
println(match.value) // <https://www.daft.ie>