What is "sanitize"

Sanitization is the process of removing specific characters from a value, which are not required or desired by the user or application.

Generally this process aims to ensure that the integrity of the application.

Among the most common cleaning tasks we can find:

  1. Leave only lower case letters:

    LEtras minúsCulas → letras minúsculas
    
  2. Exchange accented letters for the same letter without accent:

    LEtras acêntuádas → LEtras acentuadas
    
  3. Replace spaces with a hyphen (common in URL Slugs):

    URL Slug → URL-Slug
    
  4. Remove special characters:

    #Isto é uma **afirmação**! → Isto é uma afirmação
    
  5. Leave only numbers:

    +44 0800 700 200 → 440800700200