@pradnyamundwaik/string-utils
v1.1.0
Published
Scoped package for reversing and capitalizing strings belongs to pradnyamundwaik
Maintainers
Readme
"@pradnyamundwaik/string-utils",
/string-utils
A small module that exports string utility functions for reversing and capitalizing strings.
Usage
const { reverseString, capitalize } = require('./index');
console.log(reverseString('hello')); // 'olleh'
console.log(capitalize('hello')); // 'Hello'API
reverseString(str)
str(string): The text to reverse.- Returns the reversed string.
capitalize(str)
str(string): The text to capitalize.- Returns the string with first letter capitalized and rest in lowercase.
Examples
const { reverseString, capitalize } = require('./index');
console.log(reverseString('Node.js')); // 'sj.edoN'
console.log(capitalize('hELLO wORLD')); // 'Hello world'