Hey there!
Does anyone have a ready to plugin function that takes as an argument arbitrary long string and converts links written as a string into actual links.
For example:
Input string is: Please, visit our website http://www.thescripts. com and find out more about programmers community. You can also go to http://www.thescripts. com/forum/archive/index.php/f-130.html if you need help in yari, yari, yari.
Output of the function should be:
Please, visit our website <a href=”http://www.thescripts. com”> http://www.thescripts. com</a> and find out more about programmers community. You can also go to <a href=”http://www.thescripts. com/forum/archive/index.php/f-130.html”> http://www.thescripts. com/forum/archive/index.php/f-130.html </a> if you need help in yari, yari, yari.
I start with String function indexOf(“http”) but after that I get stuck. I mean I can come up with algorithm but it is so inefficient and easy to get lost in. After finding first occurrence of http I use substring, tokenizer, split etc. Does not look right. I am working on free community website and want people to add their posts with links to their website's. As of now, this is the only thing that is missing. Any help would be appreciated.
Does anyone have a ready to plugin function that takes as an argument arbitrary long string and converts links written as a string into actual links.
For example:
Input string is: Please, visit our website http://www.thescripts. com and find out more about programmers community. You can also go to http://www.thescripts. com/forum/archive/index.php/f-130.html if you need help in yari, yari, yari.
Output of the function should be:
Please, visit our website <a href=”http://www.thescripts. com”> http://www.thescripts. com</a> and find out more about programmers community. You can also go to <a href=”http://www.thescripts. com/forum/archive/index.php/f-130.html”> http://www.thescripts. com/forum/archive/index.php/f-130.html </a> if you need help in yari, yari, yari.
I start with String function indexOf(“http”) but after that I get stuck. I mean I can come up with algorithm but it is so inefficient and easy to get lost in. After finding first occurrence of http I use substring, tokenizer, split etc. Does not look right. I am working on free community website and want people to add their posts with links to their website's. As of now, this is the only thing that is missing. Any help would be appreciated.
Comment