Case sensitivity defines whether uppercase and lowercase letters are treated as different characters. For variable lists in code,
constVariable and
constvariable are different. For email rosters, they are identical. Our tool lets you toggle case sensitivity to match your requirements. If you are checking string structures against custom regular expressions before cleaning them, try our
RegEx Tester. Here is how to perform a case-insensitive deduplication check:
/* Case-insensitive string set matching */
function getInsensitiveUnique(lines) {
const seen = new Set();
return lines.filter(line => {
const checkValue = line.trim().toLowerCase();
if (seen.has(checkValue)) return false;
seen.add(checkValue);
return true;
});
}