JSPM

mb-substr

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q50674F
  • License MIT

mb-substr - Multibyte substr

Package Exports

  • mb-substr

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 (mb-substr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

mb-substr

multibyte substr

Install

$ npm install mb-substr

Usage

const mbsubstr = require('mb-substr');

mbsubstr('あいうえお', 2 ,2);
//=> 'い'

mbsubstr('あいうえお', 2);
//=> 'いうえお'

mbsubstr('あいうえお', 1, 2);
//=> ''

mbsubstr('あいうえお', 1, 3);
//=> 'い'

mbsubstr('aあいうえお', 1, 2);
//=> 'あ'

API

mbsubstr(input, [start, [len]])

input: string

start: number

len: number

License

MIT