Easiest way to convert chat text to clickable links

I have a chat screen in my App and I want that when someone sends a message like google.com or www.google.com or http://www.google.com when it appears in the chat, it is clickable. Just like I did right here in this forum post, I only wrote the text and something converted the text into clickable links automatically.

What’s the easiest way to achieve that? Would appreciate a link with an example.