Install the package using npm:
npm install react-native-stringy-core
Import the desired string manipulation methods into your React Native project:
import { reverseString, capitalize, concatStrings, truncateString, countWords, shuffleString } from 'react-native-stringy-core';
Reverses a given string.
const reversed = reverseString('Hello, World!'); console.log(reversed); // Outputs: !dlroW ,olleH
Capitalizes the first letter of a string.
const capitalized = capitalize('hello'); console.log(capitalized); // Outputs: Hello
Concatenates two strings.
const result = concatStrings('Hello', 'World!'); console.log(result); // Outputs: HelloWorld!
Truncates a string to a specified maximum length.
const truncated = truncateString('This is a long text', 10); console.log(truncated); // Outputs: This is a...
Counts the number of words in a string.
const wordCount = countWords('Hello world, how are you?'); console.log(wordCount); // Outputs: 6
Shuffles the characters of a string.
const shuffled = shuffleString('abcde'); console.log(shuffled); // Outputs: ebdca
This project is licensed under the ISC License - see the LICENSE file for details.