-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.ts
40 lines (38 loc) · 1.09 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import {
charAt,
toLowerCase,
toUpperCase,
toArray,
slice,
uncapitalize,
capitalize,
prefix,
suffix,
split,
trim,
trimStart,
trimEnd,
replaceAll,
replace,
length,
} from "../src";
const exampleStr = "The quick brown fox jumps over the lazy dog";
const _char = charAt(exampleStr, 0);
const _lower = toLowerCase(exampleStr);
const _upper = toUpperCase(exampleStr);
const _array = toArray(exampleStr);
const _slice1 = slice(exampleStr, 4, 19);
const _slice2 = slice(exampleStr, 31, 33);
const _slice3 = slice(exampleStr, 31, undefined);
const _slice4 = slice(exampleStr, 31);
const _uncapitalize = uncapitalize(exampleStr);
const _capitalize = capitalize(exampleStr);
const _prefix = prefix(exampleStr, "Well, ");
const _suffix = suffix(exampleStr, "!");
const _split = split(exampleStr, " ", 4);
const _trim = trim(" \n nice \n ");
const _trimStart = trimStart(" \n nice \n ");
const _trimEnd = trimEnd(" \n nice \n ");
const _replaceAll = replaceAll(exampleStr, " ", "_");
const _replace = replace(exampleStr, " ", "_");
const _length = length(exampleStr);