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
Nitish 73Nitish 73 

Find any URLs in the block of text on VF Page

Hi All, 

I have a requirement where I need to find if there are any URLs in a long text area and replace them with clickable links on a VF page.


User-added image


In the above screenshot, I need to make the URL clickable on the VF page. 

Here is the VF page and Apex class code 


 
<apex:page standardController="account" extensions="longtorich">
  <apex:form >
      <apex:pageBlock >
          <apex:pageBlockSection >
          <apex:outputPanel >
           <p>PARAGRAPH -------------- {!wizardQuestion}</p><br/>
          </apex:outputpanel>
          </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>







******************Controller ***********************


public class longtorich {

public String wizardQuestion { get; set; }
        public longtorich(ApexPages.StandardController controller) {
     Account a = [SELECT ID,Name, long_to_rich__c FROM Account WHERE ID=:'001j000000G7bfA'];
    wizardQuestion = a.long_to_rich__c;

    }
   
}


I would be thankful if any of you could help me with this. 


Thanks
Nitish