Introduction to Charwise
Charwise is a robust JavaScript library designed for precise character-wise string operations. Ideal for text processing, manipulation, and more. Explore the dozens of APIs and their functionalities in this article.
Getting Started with Charwise
// Include Charwise in your project
const charwise = require('charwise');
API Overview
charwise.splitByChar
Splits a string into individual characters.
charwise.splitByChar('hello');
// Output: ['h', 'e', 'l', 'l', 'o']
charwise.charAt
Returns the character at the specified index.
charwise.charAt('hello', 1);
// Output: 'e'
charwise.countChar
Counts occurrences of a specific character in a string.
charwise.countChar('hello', 'l');
// Output: 2
charwise.reverseString
Reverses the characters in a string.
charwise.reverseString('hello');
// Output: 'olleh'
charwise.isCharAt
Checks if a specific character is at a given position.
charwise.isCharAt('hello', 'e', 1);
// Output: true
charwise.charToUpper
Converts a specific character to uppercase.
charwise.charToUpper('hello', 1);
// Output: 'Hello'
charwise.charToLower
Converts a specific character to lowercase.
charwise.charToLower('HELLO', 1);
// Output: 'hELLO'
charwise.removeCharAt
Removes a character at a specific index.
charwise.removeCharAt('hello', 1);
// Output: 'hllo'
Application Example
// Example application that uses charwise library
const charwise = require('charwise');
let str = 'example';
console.log('Split Characters: ', charwise.splitByChar(str));
console.log('Character at index 2: ', charwise.charAt(str, 2));
console.log('Count of "e": ', charwise.countChar(str, 'e'));
console.log('Reversed String: ', charwise.reverseString(str));
console.log('Is "m" at index 2: ', charwise.isCharAt(str, 'm', 2));
console.log('Change char "a" to upper: ', charwise.charToUpper(str, 2));
console.log('Remove character at index 1: ', charwise.removeCharAt(str, 1));
Contact us for more detailed guides and examples.
Hash: 803b4668304e7164a144f2580cd6f466a8a38e9b1d53785409224825360cd525