function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MaheshReddyMaheshReddy 

How can display Link from string

string s ='This example parses a JSON-formatted response using JSONParser methods. It makes a callout to a web service that returns a response in JSON format.<url>https://my.salesforce.com/aEsW000000001EE<url> Next, the response is parsed to get all the totalPrice field values and compute the grandprice<url>https://cs13.my.salesforce.com/aEsW000000001EE<url>testing<url>https://cs13.my.salesforce.com/aEsW000000001EE<url>newlinktest';
how can display link in between <url><url> in vf page entaire string
please help me urgent----
srlawr uksrlawr uk
I have read that a couple of times... and I think I can see a question. I will have to make a bunch of assumptions though.

So as this is a String definition, I am assuming we are still within an Apex controller here, and then you are going to dump that string down into a VF page... 

Firstly, you will have to render the String in an unescaped output text
 
<apex:outputText value="{!s}" escape="false" />
(nice string name by the way, 's' !!)

Then to make the <url> tags more HTMLy, just do some sort of string replaces, from here : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm

I mean, having <url> as the start and end tags make that nutty hard. A really crude way to hit it could be:
 
s = s.replaceAll('<url>http', '<a href='http'); // This will catch and replace all the starting url tags
s = s.replaceAll('<url'>, '">Click Here</a>'); // this will replace all the remainin url tags with the A closures.
Then - like I said stick "s" on the page.. and you should get "a href" markup for each link with a "Click Here" text.....

Hopefully that gets you some of the way there?!