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.

13 lines (12 loc) 455 B
/** * Extracts all mentions from a given string. * * @param str - The input string to extract mentions from. * @returns An array of mentions found in the string. * * @example * extractMentions("Hello @user1 and @user2!"); // Output: ["@user1", "@user2"] * extractMentions("No mentions here!"); // Output: [] * extractMentions("@admin please check this."); // Output: ["@admin"] */ export default function extractMentions(str: string): string[];