Is Anagram



    Giovanny Gongora

    Codiga's TypeScript Recipes

    Checks if a string is an anagram of another string (case-insensitive, ignores spaces, punctuation, and special characters).

    const isAnagram = (str1: string, str2: string) => {
      const normalize = (str: string) =>
          .replace(/[^a-z0-9]/gi, '')
      return normalize(str1) === normalize(str2);
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.