UNPKG

@azizbecha/strkit

Version:

strkit is a utility library offering a collection of essential string functions including validation, case conversion, truncation, and more. Ideal for both JavaScript and TypeScript developers to simplify string operations in their applications.

14 lines (13 loc) 483 B
/** * Checks if a given string is a palindrome. * A string is considered a palindrome if it reads the same backward as forward, * ignoring case, spaces, and non-alphanumeric characters. * * @param str - The string to check. * @returns True if the string is a palindrome, false otherwise. * * @example * isPalindrome("A man, a plan, a canal: Panama"); // Output: true * isPalindrome("hello"); // Output: false */ export default function isPalindrome(str: string): boolean;