mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
add stripLeft and stripRight
This commit is contained in:
parent
bc150e1372
commit
024808fa0d
4
string/index.d.ts
vendored
4
string/index.d.ts
vendored
@ -72,6 +72,10 @@ interface StringJS {
|
||||
|
||||
strip(...strings: string[]): StringJS;
|
||||
|
||||
stripLeft(...strings: string[]): StringJS;
|
||||
|
||||
stripRight(...strings: string[]): StringJS;
|
||||
|
||||
right(n: number): StringJS;
|
||||
|
||||
setValue(string: any): StringJS;
|
||||
|
||||
@ -164,6 +164,13 @@ S('Yes it does!').replaceAll(' ', '').s; //'Yesitdoes!'
|
||||
S(' 1 2 3--__--4 5 6-7__8__9--0').strip(' ', '_', '-').s; //'1234567890'
|
||||
S('can words also be stripped out?').strip('words', 'also', 'be').s; //'can stripped out?'
|
||||
|
||||
S(' hello ').stripLeft().s; //'hello '
|
||||
S('abcz').stripLeft('a-z').s; //'bcz'
|
||||
S('www.example.com').stripLeft('w.').s; //'example.com'
|
||||
|
||||
S(' hello ').stripRight().s; //' hello'
|
||||
S('abcz').stripRight('a-z').s; //'abc'
|
||||
|
||||
S('I AM CRAZY').right(2).s; //'ZY'
|
||||
S('Does it work? ').right(4).s; //'k? '
|
||||
S('Hi').right(0).s; //''
|
||||
|
||||
Loading…
Reference in New Issue
Block a user