es-next-tools
Version:
A comprehensive utility library for JavaScript and TypeScript that provides a wide range of functions for common programming tasks, including mathematical operations, date manipulations, array and object handling, string utilities, and more.
11 lines (10 loc) • 455 B
TypeScript
/**
* Checks if a string contains a substring.
* @param {string} string - The string to search in.
* @param {string} substring - The substring to search for.
* @returns {boolean} True if the substring is found, false otherwise.
* @example
* const result = contains('Hello, world!', 'world'); // true
* const result2 = contains('Hello, world!', 'universe'); // false
*/
export declare function contains(string: string, substring: string): boolean;