Skip to content

gen6033/mb-substr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published