1

How can I replace a word in a string and make it hyperlink.. For example : This is a car. I want to replace it with,
This is a car.

I am using

 str.replaceAll("car", "<a href=\"\">$1</a>" );

Is it correct regularexpression to make it hyperlink or not? Thank you..

rose
  • 45
  • 7

1 Answers1

1

It sounds like Linkify will do what you want. See http://developer.android.com/reference/android/text/util/Linkify.html.

Edwin Evans
  • 2,726
  • 5
  • 34
  • 47