Jump to content

Trimming data


Recommended Posts

edit. I figured it out in different way. Still not sure how a TRIM function would work properly though?


Instead of:



It would be:


Basically getting rid of the http:/


Here is the code I came-up with that worked.

var s = Field("Personalized URLs");
s = ReplaceSubstring(s, "http:/", "");
return s;



Link to comment
Share on other sites

Assuming you want to eliminate everything before "www." I think it may be a better solution to use a regex to get rid of it. Especially considering most websites start with "http://" the code that you wrote would return a string starting with a "/".


The following code will replace all patterns starting with a series of letters ending with a ":" followed by one or more "/" to handle addresses that start with "http:/" , "http://", "https://", "ftp://", etc.


var s = "http://www.Ryans.MyPrePassBenefits.com";
return s.replace(/(\w+:\/+)/,"");

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...