Numerous Philanthropic Misanthropes

    uni-string
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.3 • Public • Published

    uni-string

    Unicode-aware String object

    npm install uni-string

    api

    demo

    import UString from 'packages/uni-string/src/index';
    
    const UString = require('packages/uni-string/src/index')
    console.log(UString.support);
    
    let t = (new UString('♥️𠬠典')).padStart(10, '𠬠');
    
    t = t.concat('\n♥️𠬠典そこで彼らは\'",オリーブ山と呼ばれる山からエルサレムに帰った。');
    
    console.dir(t);
    
    let t2 = new UString(t);
    
    console.log(t2);
    
    //console.log(666, t2.substr(-9, 3));
    console.log(666, t2.indexOf('𠬠典', 2));
    console.log(666, t2.endsWith('𠬠典'));
    
    let t3 = new UString('👩‍👩‍👧‍👦');
    console.log(t3.size(), t3.split(''));
    console.log('length', t2.length);
    console.log('charLength', t2.charLength);
    console.log('size()', t2.size());
    
    //length 70
    //charLength 49
    //size() 49

    UString.support

    { 
      split: true,
      substr: true,
      substring: true,
      indexOf: true,
      includes: true,
      slice: true,
      charAt: true,
      startsWith: true,
      endsWith: true,
      padEnd: true,
      padStart: true }

    Install

    npm i uni-string

    DownloadsWeekly Downloads

    4,050

    Version

    2.0.3

    License

    ISC

    Unpacked Size

    129 kB

    Total Files

    17

    Last publish

    Collaborators

    • bluelovers