@vparth/str-esc
v1.0.7
Published
String tool can join/split strings with ability to escape separator
Downloads
4
Readme
str-esc
Utility to escape entities in string
Can also split/join strings with respect of escaping
Example
// import {EscapeService} from 'str-esc';
const {EscapeService} = require('str-esc');
let svc = new EscapeService('%');
svc.encode('100% Y-m-d', ['Y', 'm', 'd']); // '100%% %Y-%m-%d'
svc = new EscapeService();
svc.split(', ', 'a, b\\, c, d'); // ['a', 'b, c', 'd']
svc.join(', ', ['a', 'b, c', 'd']); // 'a, b\\, c, d'