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
Dilyan DimitrovDilyan Dimitrov 

URL Normalization


Could you please suggest how to achieve URL Normalization in Salesforce.

What I am trying to achieve is to take particluar URL and modifie it to its most basic or standard form.


String url = "Http://";

URL normalizedURL = new URLNormalizer(url)
// Output:

The above example was taken from existing java class called URLNormalizer. I was wondering if there is a similar way to achieve URL Normalization in Salesforce.

Please advise how to make URL Normalization in Salesforce.

Leslie  KismartoniLeslie Kismartoni
There isn't a default tool inside of the the platform that does this... You'd probably have to roll your own, perhaps based on/extending the Apex URL  class ( ... I think looking at some of the java normalizers could help inform the approach?