JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3707
  • Score
    100M100P100Q116330F
  • License ISC

Unicode String object

Package Exports

  • uni-string
  • uni-string/src/core

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (uni-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

uni-string

Unicode-aware String object

npm install uni-string

api

demo

import UString from 'uni-string';
const UString = require('uni-string')
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 }