Takes a string and returns that string with all carriage returns and line breaks removed
Basic usage example:
import {whitespace} from 'stringman' // or const whitespace = require('stringman').whitespace;
const removed = whitespace.removeBreaks('this line\n has a\r dumb amount of\n line breaks');
console.log(removed); // 'this line has a dumb amount of line breaks'
Takes a string, removes tabs, and returns result
Basic usage example:
import {whitespace} from 'stringman' // or const whitespace = require('stringman').whitespace;
const removed = whitespace.removeTabs('this line has some tabs of \t multiple kinds');
console.log(removed); // 'this line has some tabs of multiple kinds'
Takes a string, an enumerable object with boolean values to detrermine what will be replaced, another string to replace things, and an optional 4th argument for whether it should be returned with multiple consecutive spaces changed to single spaces with and returns the result of replacing the values designated in the 2nd argument with the contents of the 3 argument
Basic usage example:
import {whitespace} from 'stringman' // or const whitespace = require('stringman').whitespace;
const simple = whitespace.replaceWith('gonna just\n remove breaks\n from this\n', {breaks: true}, ' ' true);
const goofy = whitespace.replaceWith('gonna make\t a \nridiculous example', {tabs: true, breaks: true, multiSpace: true}, '$');
console.log(simple); // 'gonna just remove breaks from this'
console.log(goofy); // 'gonna$make$ a$$ridiculous example'
Takes string and replaces any instance of 2 or more consecutive spaces with a single space and returns the result
Basic usage example:
import {whitespace} from 'stringman' // or const whitespace = require('stringman').whitespace;
const single = whitespace.singleSpace('this string has a dumb amount of extra spaces !');
console.log(single); // 'this string has a dumb amount of extra spaces !'
Generated using TypeDoc
Takes a string, removes all forms of witespace, and returns result
Basic usage example: