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.

17 lines 437 B
/** * Reverses the characters in a given string. * * This function takes an input string and returns a new string * with the characters in reverse order. * * @param str - The string to reverse. * @returns The reversed string. * * @example * reverse('hello'); // "olleh" * reverse('12345'); // "54321" */ export default function reverse(str) { return str.split('').reverse().join(''); } //# sourceMappingURL=reverse.js.map