Validate URL using Deluge

Validate URL using Deluge

Is there a function in Deluge to validate a URL?

I would like to move data from a custom defined text field into a custom defined URL field but only if the text field contains a valid URL.  I tried the code in https://help.zoho.com/portal/en/community/topic/forms-and-url-validation with no luck.

void workflowspace.fromWebsite2ToWebsite (int myContactID,  string myWebsite,  string myWebsite2 )

strContactID = input.myContactID.toString() ; 

map = getUrl(input.myWebsite2,false) ; 

URLresult = map.get("responseCode") ; 

crmRes = zoho.crm.updateRecord("Contacts" ,strContactID ,{ "txtIndividualGenre" : URLresult } ) ; 


URLresult is always -1.