@kietpt2003/react-native-core-ui
Version:
React Native Core UI components by KietPT
15 lines • 685 B
TypeScript
/**
* Function to limit the number of words in a string.
* @param {string} str - The string to limit. *Default:* str = ''
* @param {number} maxLength - The maximum number of words allowed. *Default:* maxLength = 5
* @returns {string} - The limited string
* @example
* ```js
* import { limitedString } from '@kietpt2003/react-native-core-ui/utils';
* const inputString = "Lorem Ipsum is simply dummy text of the printing and typesetting industry";
* console.log(limitedString(inputString)); // "Lorem Ipsum is simply dummy..."
* ```
*/
declare const _default: (str?: string, maxLength?: number) => string;
export default _default;
//# sourceMappingURL=limitedString.d.ts.map