@c_s_v_s_subrahmanyam/string-utils
Version:
A comprehensive utility library for advanced string operations.
13 lines (8 loc) • 412 B
JavaScript
// String comparison utilities
module.exports = {
equalsIgnoreCase: (str1, str2) => str1.toLowerCase() === str2.toLowerCase(),
compareLexicographically: (str1, str2) => str1.localeCompare(str2),
startsWith: (str, prefix) => str.startsWith(prefix),
endsWith: (str, suffix) => str.endsWith(suffix),
containsSubstring: (str, substring) => str.includes(substring),
};