rpaterick Posted February 16, 2012 Share Posted February 16, 2012 (edited) edit. I figured it out in different way. Still not sure how a TRIM function would work properly though? Instead of: http:/www.Ryans.MyPrePassBenefits.com It would be: www.Ryans.MyPrePassBenefits.com 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; Thanks Edited February 16, 2012 by rpaterick Quote Link to comment Share on other sites More sharing options...
step Posted February 17, 2012 Share Posted February 17, 2012 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+:\/+)/,""); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.