UNPKG
charset-pl
Version:
latest (2.0.0)
2.0.0
1.0.0
0.4.0
0.3.0
0.2.1
0.2.0
0.1.1
0.1.0
0.0.1
polish charset? idk
charset-pl
/
lib
/
tools
/
split.ts
11 lines
(10 loc)
•
239 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
export
default
function
split
(
i
:
string
,
l
:
number
=
8
):
Array
<
string
> {
var
a = []
while
(i.
length
> l) { a.
push
(i.
substring
(i.
length
- l, i.
length
)) i = i.
substring
(
0
, i.
length
- l) } a.
push
(i) a.
reverse
()
return
a }