@tolki/str 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ascii/index.d.ts +4 -4
- package/dist/ascii/index.d.ts.map +1 -1
- package/dist/base64/index.d.ts +4 -0
- package/dist/base64/index.d.ts.map +1 -1
- package/dist/convertcase/index.d.ts +2 -8
- package/dist/convertcase/index.d.ts.map +1 -1
- package/dist/markdown/index.d.ts +5 -8
- package/dist/markdown/index.d.ts.map +1 -1
- package/dist/markdown/index.js +21 -20
- package/dist/pluralizer/index.d.ts +8 -14
- package/dist/pluralizer/index.d.ts.map +1 -1
- package/dist/replacer/index.d.ts +6 -0
- package/dist/replacer/index.d.ts.map +1 -1
- package/dist/str.d.ts +82 -254
- package/dist/str.d.ts.map +1 -1
- package/dist/str.js +164 -163
- package/dist/stringable/index.d.ts +4 -8
- package/dist/stringable/index.d.ts.map +1 -1
- package/dist/stringable/index.js +2 -2
- package/dist/transliterate/index.d.ts +1 -3
- package/dist/transliterate/index.d.ts.map +1 -1
- package/dist/trimmer/index.d.ts +6 -0
- package/dist/trimmer/index.d.ts.map +1 -1
- package/dist/ulid/index.d.ts +8 -18
- package/dist/ulid/index.d.ts.map +1 -1
- package/dist/uuid/index.d.ts +10 -21
- package/dist/uuid/index.d.ts.map +1 -1
- package/package.json +5 -4
package/dist/str.d.ts
CHANGED
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
* @returns The portion of the string after the last occurrence of the search value
|
|
7
7
|
*
|
|
8
8
|
* @see https://tolki.abe.dev/strings/string-utilities-list.html#after
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
*
|
|
12
|
-
* after('A house on a lake', 'house '); -> 'on a lake'
|
|
13
9
|
*/
|
|
14
10
|
export declare function after(subject: string, search: string | number): string;
|
|
15
11
|
/**
|
|
@@ -28,6 +24,8 @@ export declare function afterLast(subject: string, search: string | number): str
|
|
|
28
24
|
* @param subject - The string to search in
|
|
29
25
|
* @param search - The value to search for
|
|
30
26
|
* @returns The portion of the string before the first occurrence of the search value
|
|
27
|
+
*
|
|
28
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#before
|
|
31
29
|
*/
|
|
32
30
|
export declare function before(subject: string, search: string | number): string;
|
|
33
31
|
/**
|
|
@@ -37,9 +35,7 @@ export declare function before(subject: string, search: string | number): string
|
|
|
37
35
|
* @param search - The value to search for
|
|
38
36
|
* @returns The portion of the string before the last occurrence of the search value
|
|
39
37
|
*
|
|
40
|
-
* @
|
|
41
|
-
*
|
|
42
|
-
* beforeLast('yvette', 'tte'); -> 'yve'
|
|
38
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#beforelast
|
|
43
39
|
*/
|
|
44
40
|
export declare function beforeLast(subject: string, search: string | number): string;
|
|
45
41
|
/**
|
|
@@ -50,9 +46,7 @@ export declare function beforeLast(subject: string, search: string | number): st
|
|
|
50
46
|
* @param to - The ending value
|
|
51
47
|
* @returns The portion of the string between the two given values
|
|
52
48
|
*
|
|
53
|
-
* @
|
|
54
|
-
*
|
|
55
|
-
* between('foofoobar', 'foo', 'bar'); -> 'foo'
|
|
49
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#between
|
|
56
50
|
*/
|
|
57
51
|
export declare function between(subject: string, from: string | number, to: string | number): string;
|
|
58
52
|
/**
|
|
@@ -63,9 +57,7 @@ export declare function between(subject: string, from: string | number, to: stri
|
|
|
63
57
|
* @param to - The ending value
|
|
64
58
|
* @returns The smallest portion of the string between the two given values
|
|
65
59
|
*
|
|
66
|
-
* @
|
|
67
|
-
*
|
|
68
|
-
* betweenFirst('foofoobar', 'foo', 'bar'); -> 'foo'
|
|
60
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#betweenfirst
|
|
69
61
|
*/
|
|
70
62
|
export declare function betweenFirst(subject: string, from: string | number, to: string | number): string;
|
|
71
63
|
/**
|
|
@@ -74,9 +66,7 @@ export declare function betweenFirst(subject: string, from: string | number, to:
|
|
|
74
66
|
* @param value - The string to convert
|
|
75
67
|
* @returns The camel-cased string
|
|
76
68
|
*
|
|
77
|
-
* @
|
|
78
|
-
*
|
|
79
|
-
* camel('foo_bar'); -> 'fooBar'
|
|
69
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#camel
|
|
80
70
|
*/
|
|
81
71
|
export declare function camel(value: string): string;
|
|
82
72
|
/**
|
|
@@ -86,9 +76,7 @@ export declare function camel(value: string): string;
|
|
|
86
76
|
* @param index - The index of the character to get
|
|
87
77
|
* @returns The character at the specified index, or false if the index is out of bounds
|
|
88
78
|
*
|
|
89
|
-
* @
|
|
90
|
-
*
|
|
91
|
-
* charAt('hello', 1); -> 'e'
|
|
79
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#charat
|
|
92
80
|
*/
|
|
93
81
|
export declare function charAt(subject: string, index: number): string | false;
|
|
94
82
|
/**
|
|
@@ -98,9 +86,7 @@ export declare function charAt(subject: string, index: number): string | false;
|
|
|
98
86
|
* @param needle - The string or strings to remove
|
|
99
87
|
* @returns The string with the given string(s) removed from the start
|
|
100
88
|
*
|
|
101
|
-
* @
|
|
102
|
-
*
|
|
103
|
-
* chopStart('foobar', 'foo'); -> 'bar'
|
|
89
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#chopstart
|
|
104
90
|
*/
|
|
105
91
|
export declare function chopStart(subject: string, needle: string | string[]): string;
|
|
106
92
|
/**
|
|
@@ -110,9 +96,7 @@ export declare function chopStart(subject: string, needle: string | string[]): s
|
|
|
110
96
|
* @param needle - The string or strings to remove
|
|
111
97
|
* @returns The string with the given string(s) removed from the end
|
|
112
98
|
*
|
|
113
|
-
* @
|
|
114
|
-
*
|
|
115
|
-
* chopEnd('foobar', 'bar'); -> 'foo'
|
|
99
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#chopend
|
|
116
100
|
*/
|
|
117
101
|
export declare function chopEnd(subject: string, needle: string | string[]): string;
|
|
118
102
|
/**
|
|
@@ -122,11 +106,7 @@ export declare function chopEnd(subject: string, needle: string | string[]): str
|
|
|
122
106
|
* @param needles - The substring or substrings to search for
|
|
123
107
|
* @param ignoreCase - Whether to ignore case when searching
|
|
124
108
|
*
|
|
125
|
-
* @
|
|
126
|
-
*
|
|
127
|
-
* contains('Minion', 'ni'); -> true
|
|
128
|
-
* contains('Minion', 'Ni', true); -> true
|
|
129
|
-
* contains('Minion', 'Ni', false); -> false
|
|
109
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#contains
|
|
130
110
|
*/
|
|
131
111
|
export declare function contains(haystack: string, needles: string | Iterable<string>, ignoreCase?: boolean): boolean;
|
|
132
112
|
/**
|
|
@@ -137,8 +117,7 @@ export declare function contains(haystack: string, needles: string | Iterable<st
|
|
|
137
117
|
* @param options - Additional options for excerpt extraction
|
|
138
118
|
* @returns The extracted excerpt, or null if the phrase is not found
|
|
139
119
|
*
|
|
140
|
-
* @
|
|
141
|
-
* excerpt('The quick brown fox', 'brown', { radius: 5 });
|
|
120
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#excerpt
|
|
142
121
|
*/
|
|
143
122
|
export declare function excerpt(text: string | null, phrase?: string | null, options?: {
|
|
144
123
|
radius?: number;
|
|
@@ -152,10 +131,7 @@ export declare function excerpt(text: string | null, phrase?: string | null, opt
|
|
|
152
131
|
* @param ignoreCase - Whether to ignore case when searching
|
|
153
132
|
* @returns True if all substrings are found, false otherwise
|
|
154
133
|
*
|
|
155
|
-
* @
|
|
156
|
-
*
|
|
157
|
-
* containsAll('Taylor Otwell', ['taylor', 'otwell'], false); -> true
|
|
158
|
-
* containsAll('Taylor Otwell', ['taylor', 'xxx'], true); -> false
|
|
134
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#containsall
|
|
159
135
|
*/
|
|
160
136
|
export declare function containsAll(haystack: string, needles: Iterable<string>, ignoreCase?: boolean): boolean;
|
|
161
137
|
/**
|
|
@@ -166,11 +142,7 @@ export declare function containsAll(haystack: string, needles: Iterable<string>,
|
|
|
166
142
|
* @param ignoreCase - Whether to ignore case when searching
|
|
167
143
|
* @returns True if the substring is not found, false otherwise
|
|
168
144
|
*
|
|
169
|
-
* @
|
|
170
|
-
*
|
|
171
|
-
* doesntContain('Minion', 'ni'); -> false
|
|
172
|
-
* doesntContain('Minion', 'Ni', true); -> false
|
|
173
|
-
* doesntContain('Minion', 'Ni', false); -> true
|
|
145
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#doesntcontain
|
|
174
146
|
*/
|
|
175
147
|
export declare function doesntContain(haystack: string, needles: string | Iterable<string>, ignoreCase?: boolean): boolean;
|
|
176
148
|
/**
|
|
@@ -180,12 +152,7 @@ export declare function doesntContain(haystack: string, needles: string | Iterab
|
|
|
180
152
|
* @param character - The character or characters to deduplicate
|
|
181
153
|
* @returns The string with consecutive instances of the character(s) replaced by a single instance
|
|
182
154
|
*
|
|
183
|
-
* @
|
|
184
|
-
*
|
|
185
|
-
* deduplicate('hello world'); -> 'hello world'
|
|
186
|
-
* deduplicate('hello---world', '-'); -> 'hello-world'
|
|
187
|
-
* deduplicate('hello___world', '_'); -> 'hello-world'
|
|
188
|
-
* deduplicate('hello world', ' '); -> 'hello world'
|
|
155
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#deduplicate
|
|
189
156
|
*/
|
|
190
157
|
export declare function deduplicate(value: string, character?: string | string[]): string;
|
|
191
158
|
/**
|
|
@@ -195,10 +162,7 @@ export declare function deduplicate(value: string, character?: string | string[]
|
|
|
195
162
|
* @param needles - The substring or substrings to search for
|
|
196
163
|
* @returns True if the string ends with any of the substrings, false otherwise
|
|
197
164
|
*
|
|
198
|
-
* @
|
|
199
|
-
*
|
|
200
|
-
* endsWith("Jason", "on"); -> true
|
|
201
|
-
* endsWith("Jason", "ON"); -> false
|
|
165
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#endswith
|
|
202
166
|
*/
|
|
203
167
|
export declare function endsWith(haystack: string | number | null, needles: string | number | Iterable<string>): boolean;
|
|
204
168
|
/**
|
|
@@ -208,10 +172,7 @@ export declare function endsWith(haystack: string | number | null, needles: stri
|
|
|
208
172
|
* @param needles - The substring or substrings to search for
|
|
209
173
|
* @returns True if the string does not end with any of the substrings, false otherwise
|
|
210
174
|
*
|
|
211
|
-
* @
|
|
212
|
-
*
|
|
213
|
-
* doesntEndWith("Jason", "on"); -> false
|
|
214
|
-
* doesntEndWith("Jason", "ON"); -> true
|
|
175
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#doesntendwith
|
|
215
176
|
*/
|
|
216
177
|
export declare function doesntEndWith(haystack: string | number | null, needles: string | number | Iterable<string>): boolean;
|
|
217
178
|
/**
|
|
@@ -221,9 +182,7 @@ export declare function doesntEndWith(haystack: string | number | null, needles:
|
|
|
221
182
|
* @param cap - The string to cap with
|
|
222
183
|
* @returns The capped string
|
|
223
184
|
*
|
|
224
|
-
* @
|
|
225
|
-
*
|
|
226
|
-
* finish('hello', '!'); -> 'hello!'
|
|
185
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#finish
|
|
227
186
|
*/
|
|
228
187
|
export declare function finish(value: string, cap: string): string;
|
|
229
188
|
/**
|
|
@@ -234,9 +193,7 @@ export declare function finish(value: string, cap: string): string;
|
|
|
234
193
|
* @param after - The string to append (if null, use the 'before' string)
|
|
235
194
|
* @returns The wrapped string
|
|
236
195
|
*
|
|
237
|
-
* @
|
|
238
|
-
*
|
|
239
|
-
* wrap('hello', '[', ']'); -> '[hello]'
|
|
196
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#wrap
|
|
240
197
|
*/
|
|
241
198
|
export declare function wrap(value: string, before: string, after?: string | null): string;
|
|
242
199
|
/**
|
|
@@ -247,9 +204,7 @@ export declare function wrap(value: string, before: string, after?: string | nul
|
|
|
247
204
|
* @param after - The string to remove from the end (if null, use the 'before' string)
|
|
248
205
|
* @returns The unwrapped string
|
|
249
206
|
*
|
|
250
|
-
* @
|
|
251
|
-
*
|
|
252
|
-
* unwrap('[hello]', '[', ']'); -> 'hello'
|
|
207
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#unwrap
|
|
253
208
|
*/
|
|
254
209
|
export declare function unwrap(value: string, before: string, after?: string | null): string;
|
|
255
210
|
/**
|
|
@@ -260,11 +215,7 @@ export declare function unwrap(value: string, before: string, after?: string | n
|
|
|
260
215
|
* @param ignoreCase - Whether to ignore case when matching
|
|
261
216
|
* @return True if the string matches the pattern, false otherwise
|
|
262
217
|
*
|
|
263
|
-
* @
|
|
264
|
-
*
|
|
265
|
-
* is('hello', 'hello'); -> true
|
|
266
|
-
* is('hello', 'Hello', true); -> true
|
|
267
|
-
* is('hello', 'world'); -> false
|
|
218
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#is
|
|
268
219
|
*/
|
|
269
220
|
export declare function is(pattern: string | Iterable<string>, value: string | number, ignoreCase?: boolean): boolean;
|
|
270
221
|
/**
|
|
@@ -273,13 +224,7 @@ export declare function is(pattern: string | Iterable<string>, value: string | n
|
|
|
273
224
|
* @param value - The string to check
|
|
274
225
|
* @returns True if the string is ASCII, false otherwise
|
|
275
226
|
*
|
|
276
|
-
* @
|
|
277
|
-
*
|
|
278
|
-
* isAscii("Hello World"); -> true
|
|
279
|
-
* isAscii("こんにちは"); -> false
|
|
280
|
-
* isAscii("12345"); -> true
|
|
281
|
-
* isAscii("!@#$%"); -> true
|
|
282
|
-
* isAscii("Hello こんにちは"); -> false
|
|
227
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#isascii
|
|
283
228
|
*/
|
|
284
229
|
export declare function isAscii(value: string): boolean;
|
|
285
230
|
/**
|
|
@@ -288,11 +233,7 @@ export declare function isAscii(value: string): boolean;
|
|
|
288
233
|
* @param value - The value to check if it's JSON
|
|
289
234
|
* @returns True if the value is valid JSON, false otherwise
|
|
290
235
|
*
|
|
291
|
-
* @
|
|
292
|
-
*
|
|
293
|
-
* isJson('{"name": "John", "age": 30}'); -> true
|
|
294
|
-
* isJson('{"name": "John", "age": 30'); -> false
|
|
295
|
-
* isJson('Hello World'); -> false
|
|
236
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#isjson
|
|
296
237
|
*/
|
|
297
238
|
export declare function isJson(value: unknown): boolean;
|
|
298
239
|
/**
|
|
@@ -302,11 +243,7 @@ export declare function isJson(value: unknown): boolean;
|
|
|
302
243
|
* @param protocols - An optional array of allowed protocols (e.g., ['http', 'https'])
|
|
303
244
|
* @return True if the value is a valid URL, false otherwise
|
|
304
245
|
*
|
|
305
|
-
* @
|
|
306
|
-
*
|
|
307
|
-
* isUrl('https://laravel.com'); -> true
|
|
308
|
-
* isUrl('http://localhost'); -> true
|
|
309
|
-
* isUrl('invalid url'); -> false
|
|
246
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#isurl
|
|
310
247
|
*/
|
|
311
248
|
export declare function isUrl(value: string | unknown, protocols?: string[]): boolean;
|
|
312
249
|
/**
|
|
@@ -315,9 +252,7 @@ export declare function isUrl(value: string | unknown, protocols?: string[]): bo
|
|
|
315
252
|
* @param value - The string to convert
|
|
316
253
|
* @returns The kebab-cased string
|
|
317
254
|
*
|
|
318
|
-
* @
|
|
319
|
-
*
|
|
320
|
-
* kebab("Laravel PHP Framework"); -> "laravel-php-framework"
|
|
255
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#kebab
|
|
321
256
|
*/
|
|
322
257
|
export declare function kebab(value: string): string;
|
|
323
258
|
/**
|
|
@@ -326,9 +261,7 @@ export declare function kebab(value: string): string;
|
|
|
326
261
|
* @param value - The string to measure
|
|
327
262
|
* @returns The length of the string
|
|
328
263
|
*
|
|
329
|
-
* @
|
|
330
|
-
*
|
|
331
|
-
* length("Hello World"); -> 11
|
|
264
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#length
|
|
332
265
|
*/
|
|
333
266
|
export declare function length(value: string): number;
|
|
334
267
|
/**
|
|
@@ -339,6 +272,8 @@ export declare function length(value: string): number;
|
|
|
339
272
|
* @param end - The string to append if the value is truncated
|
|
340
273
|
* @param preserveWords - Whether to preserve whole words when truncating
|
|
341
274
|
* @returns The limited string
|
|
275
|
+
*
|
|
276
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#limit
|
|
342
277
|
*/
|
|
343
278
|
export declare function limit(value: string, limit?: number, end?: string, preserveWords?: boolean): string;
|
|
344
279
|
/**
|
|
@@ -347,9 +282,7 @@ export declare function limit(value: string, limit?: number, end?: string, prese
|
|
|
347
282
|
* @param value - The string to convert
|
|
348
283
|
* @returns The lower-cased string
|
|
349
284
|
*
|
|
350
|
-
* @
|
|
351
|
-
*
|
|
352
|
-
* lower("Hello World"); -> "hello world"
|
|
285
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#lower
|
|
353
286
|
*/
|
|
354
287
|
export declare function lower(value: string): string;
|
|
355
288
|
/**
|
|
@@ -360,10 +293,7 @@ export declare function lower(value: string): string;
|
|
|
360
293
|
* @param end - The string to append if the value is truncated
|
|
361
294
|
* @returns The limited string
|
|
362
295
|
*
|
|
363
|
-
* @
|
|
364
|
-
*
|
|
365
|
-
* words("Laravel PHP Framework", 2); -> "Laravel PHP Framework"
|
|
366
|
-
* words("Laravel PHP Framework", 1); -> "Laravel..."
|
|
296
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#words
|
|
367
297
|
*/
|
|
368
298
|
export declare function words(value: string, words?: number, end?: string): string;
|
|
369
299
|
/**
|
|
@@ -375,12 +305,7 @@ export declare function words(value: string, words?: number, end?: string): stri
|
|
|
375
305
|
* @param length - The number of characters to mask (if null, mask to the end of the string)
|
|
376
306
|
* @returns The masked string
|
|
377
307
|
*
|
|
378
|
-
* @
|
|
379
|
-
*
|
|
380
|
-
* mask("taylor@email.com", "*", 3); -> "tay*************"
|
|
381
|
-
* mask("taylor@email.com", "*", 0, 6); -> "******@email.com"
|
|
382
|
-
* mask("taylor@email.com", "*", -13); -> "tay*************"
|
|
383
|
-
* mask("taylor@email.com", "*", -13, 3); -> "tay***@email.com"
|
|
308
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#mask
|
|
384
309
|
*/
|
|
385
310
|
export declare function mask(value: string, character: string, index: number, length?: number | null): string;
|
|
386
311
|
/**
|
|
@@ -389,6 +314,8 @@ export declare function mask(value: string, character: string, index: number, le
|
|
|
389
314
|
* @param pattern - The regex pattern to match
|
|
390
315
|
* @param subject - The string to search within
|
|
391
316
|
* @returns The matched string or an empty string if no match
|
|
317
|
+
*
|
|
318
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#match
|
|
392
319
|
*/
|
|
393
320
|
export declare function match(pattern: string, subject: string): string;
|
|
394
321
|
/**
|
|
@@ -398,22 +325,17 @@ export declare function match(pattern: string, subject: string): string;
|
|
|
398
325
|
* @param value - The string to check
|
|
399
326
|
* @return True if the string matches the pattern, false otherwise
|
|
400
327
|
*
|
|
401
|
-
* @
|
|
402
|
-
*
|
|
403
|
-
* Str::isMatch('/foo/', 'foo bar'); // true
|
|
404
|
-
* Str::isMatch('/bar/', 'foo bar'); // false
|
|
328
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#ismatch
|
|
405
329
|
*/
|
|
406
330
|
export declare function isMatch(pattern: string | Iterable<string>, value: string): boolean;
|
|
407
331
|
/**
|
|
408
|
-
* Get the string matching the given pattern.
|
|
332
|
+
* Get the string(s) matching the given pattern.
|
|
409
333
|
*
|
|
410
334
|
* @param pattern - The regex pattern to match
|
|
411
335
|
* @param subject - The string to search within
|
|
412
336
|
* @returns An array of all matched strings
|
|
413
337
|
*
|
|
414
|
-
* @
|
|
415
|
-
*
|
|
416
|
-
* matchAll("/foo (.*)/", "foo bar baz"); -> ["foo bar baz"]
|
|
338
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#matchall
|
|
417
339
|
*/
|
|
418
340
|
export declare function matchAll(pattern: string, subject: string): string[];
|
|
419
341
|
/**
|
|
@@ -422,51 +344,40 @@ export declare function matchAll(pattern: string, subject: string): string[];
|
|
|
422
344
|
* @param value - The string or array of strings to process
|
|
423
345
|
* @returns The numeric-only string or array of strings
|
|
424
346
|
*
|
|
425
|
-
* @
|
|
426
|
-
*
|
|
427
|
-
* numbers("foo123bar"); -> "123"
|
|
428
|
-
* numbers(["foo123bar", "abc456"]); -> ["123", "456"]
|
|
347
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#numbers
|
|
429
348
|
*/
|
|
430
349
|
export declare function numbers(value: string | string[]): string | string[];
|
|
431
350
|
/**
|
|
432
|
-
* Pad both sides of a string with another.
|
|
351
|
+
* Pad both sides of a string with another string to a certain length.
|
|
433
352
|
*
|
|
434
353
|
* @param value - The string to pad
|
|
435
354
|
* @param length - The desired total length after padding
|
|
436
355
|
* @param pad - The string to use for padding
|
|
437
356
|
* @returns The padded string
|
|
357
|
+
*
|
|
358
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#padboth
|
|
438
359
|
*/
|
|
439
360
|
export declare function padBoth(value: string, length: number, pad?: string): string;
|
|
440
361
|
/**
|
|
441
|
-
* Pad the left side of a string with another.
|
|
362
|
+
* Pad the left side of a string with another string to a certain length.
|
|
442
363
|
*
|
|
443
364
|
* @param value - The string to pad
|
|
444
365
|
* @param length - The desired total length after padding
|
|
445
366
|
* @param pad - The string to use for padding
|
|
446
367
|
* @returns The padded string
|
|
447
368
|
*
|
|
448
|
-
* @
|
|
449
|
-
*
|
|
450
|
-
* padLeft("Alien", 10, "-="); -> "-=-=-Alien"
|
|
451
|
-
* padLeft("Alien", 10); -> " Alien"
|
|
452
|
-
* padLeft("❤MultiByte☆", 16); -> " ❤MultiByte☆"
|
|
453
|
-
* padLeft("❤MultiByte☆", 16, "❤☆"); -> "❤☆❤☆❤❤MultiByte☆"
|
|
369
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#padleft
|
|
454
370
|
*/
|
|
455
371
|
export declare function padLeft(value: string, length: number, pad?: string): string;
|
|
456
372
|
/**
|
|
457
|
-
* Pad the right side of a string with another.
|
|
373
|
+
* Pad the right side of a string with another string to a certain length.
|
|
458
374
|
*
|
|
459
375
|
* @param value - The string to pad
|
|
460
376
|
* @param length - The desired total length after padding
|
|
461
377
|
* @param pad - The string to use for padding
|
|
462
378
|
* @returns The padded string
|
|
463
379
|
*
|
|
464
|
-
* @
|
|
465
|
-
*
|
|
466
|
-
* padRight("Alien", 10, "-="); -> "Alien-=-="
|
|
467
|
-
* padRight("Alien", 10); -> "Alien "
|
|
468
|
-
* padRight("❤MultiByte☆", 16); -> "❤MultiByte☆ "
|
|
469
|
-
* padRight("❤MultiByte☆", 16, "❤☆"); -> "❤MultiByte☆❤☆❤☆"
|
|
380
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#padright
|
|
470
381
|
*/
|
|
471
382
|
export declare function padRight(value: string, length: number, pad?: string): string;
|
|
472
383
|
/**
|
|
@@ -497,6 +408,8 @@ export declare function makePad(padStr: string, needed: number): string;
|
|
|
497
408
|
* @param symbols Whether to include symbols (default: true)
|
|
498
409
|
* @param spaces Whether to include spaces (default: false)
|
|
499
410
|
* @return The generated password string
|
|
411
|
+
*
|
|
412
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#password
|
|
500
413
|
*/
|
|
501
414
|
export declare function password(length?: number, letters?: boolean, numbers?: boolean, symbols?: boolean, spaces?: boolean): string;
|
|
502
415
|
/**
|
|
@@ -507,10 +420,7 @@ export declare function password(length?: number, letters?: boolean, numbers?: b
|
|
|
507
420
|
* @param offset - The position to start searching from (can be negative)
|
|
508
421
|
* @returns The position of the first occurrence or false if not found
|
|
509
422
|
*
|
|
510
|
-
* @
|
|
511
|
-
*
|
|
512
|
-
* position('Hello, World!', 'World!'); -> 7
|
|
513
|
-
* position('Hello, World!', 'world!', 0); -> false
|
|
423
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#position
|
|
514
424
|
*/
|
|
515
425
|
export declare function position(haystack: string, needle: string, offset?: number): number | false;
|
|
516
426
|
/**
|
|
@@ -519,9 +429,7 @@ export declare function position(haystack: string, needle: string, offset?: numb
|
|
|
519
429
|
* @param length - The desired length of the random string (default: 16)
|
|
520
430
|
* @returns The generated random string
|
|
521
431
|
*
|
|
522
|
-
* @
|
|
523
|
-
*
|
|
524
|
-
* random(); -> "a1b2c3d4e5f6g7h8"
|
|
432
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#random
|
|
525
433
|
*/
|
|
526
434
|
export declare function random(length?: number): string;
|
|
527
435
|
/**
|
|
@@ -530,9 +438,7 @@ export declare function random(length?: number): string;
|
|
|
530
438
|
* @param factory - The factory function to generate random strings
|
|
531
439
|
* @returns void
|
|
532
440
|
*
|
|
533
|
-
* @
|
|
534
|
-
*
|
|
535
|
-
* createRandomStringsUsing((length) => "x".repeat(length));
|
|
441
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#random
|
|
536
442
|
*/
|
|
537
443
|
export declare function createRandomStringsUsing(factory: ((length: number) => string) | null): void;
|
|
538
444
|
/**
|
|
@@ -553,9 +459,7 @@ export declare function createRandomStringsUsingSequence(sequence: string[], whe
|
|
|
553
459
|
*
|
|
554
460
|
* @returns void
|
|
555
461
|
*
|
|
556
|
-
* @
|
|
557
|
-
*
|
|
558
|
-
* createRandomStringsNormally();
|
|
462
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#random
|
|
559
463
|
*/
|
|
560
464
|
export declare function createRandomStringsNormally(): void;
|
|
561
465
|
/**
|
|
@@ -565,9 +469,7 @@ export declare function createRandomStringsNormally(): void;
|
|
|
565
469
|
* @param times - The number of times to repeat the string
|
|
566
470
|
* @returns The repeated string
|
|
567
471
|
*
|
|
568
|
-
* @
|
|
569
|
-
*
|
|
570
|
-
* repeat("foo", 3); -> "foofoofoo"
|
|
472
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#repeat
|
|
571
473
|
*/
|
|
572
474
|
export declare function repeat(string: string, times: number): string;
|
|
573
475
|
/**
|
|
@@ -578,11 +480,7 @@ export declare function repeat(string: string, times: number): string;
|
|
|
578
480
|
* @param subject - The string to perform replacements on
|
|
579
481
|
* @returns The resulting string after replacements
|
|
580
482
|
*
|
|
581
|
-
* @
|
|
582
|
-
*
|
|
583
|
-
* replaceArray('?', ['foo', 'bar', 'baz'], '?/?/?'); -> 'foo/bar/baz'
|
|
584
|
-
* replaceArray('?', ['foo', 'bar', 'baz'], '?/?/?/?'); -> 'foo/bar/baz/?'
|
|
585
|
-
* replaceArray('?', {'x' => 'foo', 'y' => 'bar'}, '?/?'); -> 'foo/bar'
|
|
483
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#replacearray
|
|
586
484
|
*/
|
|
587
485
|
export declare function replaceArray(search: string, replace: Record<string, string> | Iterable<string>, subject: string): string;
|
|
588
486
|
/**
|
|
@@ -606,9 +504,7 @@ export declare function toStringOr(value: unknown, fallback: string): string;
|
|
|
606
504
|
* @param caseSensitive - Whether the search should be case-sensitive (default: true)
|
|
607
505
|
* @returns The resulting string or array of strings after replacements
|
|
608
506
|
*
|
|
609
|
-
* @
|
|
610
|
-
*
|
|
611
|
-
* replace("foo", "bar", "foo baz"); -> "bar baz"
|
|
507
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#replace
|
|
612
508
|
*/
|
|
613
509
|
export declare function replace<T extends string | Iterable<string>>(search: string | Iterable<string>, replacement: string | Iterable<string>, subject: T, caseSensitive?: boolean): T extends string ? string : string[];
|
|
614
510
|
/**
|
|
@@ -619,9 +515,7 @@ export declare function replace<T extends string | Iterable<string>>(search: str
|
|
|
619
515
|
* @param subject - The string to perform the replacement on
|
|
620
516
|
* @returns The resulting string after replacement
|
|
621
517
|
*
|
|
622
|
-
* @
|
|
623
|
-
*
|
|
624
|
-
* replaceFirst('bar', 'qux', 'foobar foobar'); -> 'fooqux foobar'
|
|
518
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#replacefirst
|
|
625
519
|
*/
|
|
626
520
|
export declare function replaceFirst(search: string | number, replace: string, subject: string): string;
|
|
627
521
|
/**
|
|
@@ -631,6 +525,8 @@ export declare function replaceFirst(search: string | number, replace: string, s
|
|
|
631
525
|
* @param replace - The value to replace with
|
|
632
526
|
* @param subject - The string to perform the replacement on
|
|
633
527
|
* @returns The resulting string after replacement
|
|
528
|
+
*
|
|
529
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#replacestart
|
|
634
530
|
*/
|
|
635
531
|
export declare function replaceStart(search: string | number, replace: string, subject: string): string;
|
|
636
532
|
/**
|
|
@@ -641,9 +537,7 @@ export declare function replaceStart(search: string | number, replace: string, s
|
|
|
641
537
|
* @param subject - The string to perform the replacement on
|
|
642
538
|
* @returns The resulting string after replacement
|
|
643
539
|
*
|
|
644
|
-
* @
|
|
645
|
-
*
|
|
646
|
-
* replaceLast('bar', 'qux', 'foobar foobar'); -> 'foobar foobarqux'
|
|
540
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#replacelast
|
|
647
541
|
*/
|
|
648
542
|
export declare function replaceLast(search: string | number, replace: string, subject: string): string;
|
|
649
543
|
/**
|
|
@@ -654,25 +548,19 @@ export declare function replaceLast(search: string | number, replace: string, su
|
|
|
654
548
|
* @param subject - The string to perform the replacement on
|
|
655
549
|
* @returns The resulting string after replacement
|
|
656
550
|
*
|
|
657
|
-
* @
|
|
658
|
-
*
|
|
659
|
-
* replaceEnd('bar', 'qux', 'foobar foobar'); -> 'foobar fooqux'
|
|
551
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#replaceend
|
|
660
552
|
*/
|
|
661
553
|
export declare function replaceEnd(search: string | number, replace: string, subject: string): string;
|
|
662
554
|
/**
|
|
663
555
|
* Replace the patterns matching the given regular expression.
|
|
664
556
|
*
|
|
665
557
|
* @param pattern - The regex pattern or patterns to search for
|
|
666
|
-
* @param replace - The replacement string, array of strings, or
|
|
558
|
+
* @param replace - The replacement string, array of strings, or closure
|
|
667
559
|
* @param subject - The string or array of strings to perform replacements on
|
|
668
560
|
* @param limit - The maximum number of replacements per pattern (-1 for no limit)
|
|
669
561
|
* @returns The resulting string, array of strings, or null on error
|
|
670
562
|
*
|
|
671
|
-
* @
|
|
672
|
-
*
|
|
673
|
-
* replaceMatches(/foo/, 'bar', 'foobar'); -> 'barbar'
|
|
674
|
-
* replaceMatches(/foo/, ['bar', 'baz'], 'foobar'); -> ['barbar', 'foobaz']
|
|
675
|
-
* replaceMatches(/foo/, (match) => match[1]!.toUpperCase(), 'foobar'); -> 'Bar'
|
|
563
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#replacematches
|
|
676
564
|
*/
|
|
677
565
|
export declare function replaceMatches(pattern: string | string[] | RegExp | RegExp[], replace: string | string[] | ((match: string[]) => string), subject: string | string[], limit?: number): string | string[] | null;
|
|
678
566
|
/**
|
|
@@ -681,9 +569,7 @@ export declare function replaceMatches(pattern: string | string[] | RegExp | Reg
|
|
|
681
569
|
* @param value - The string to process
|
|
682
570
|
* @returns The string with HTML tags removed
|
|
683
571
|
*
|
|
684
|
-
* @
|
|
685
|
-
*
|
|
686
|
-
* stripTags("<p>Hello World</p>"); -> "Hello World"
|
|
572
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#striptags
|
|
687
573
|
*/
|
|
688
574
|
export declare function stripTags(value: string): string;
|
|
689
575
|
/**
|
|
@@ -694,10 +580,7 @@ export declare function stripTags(value: string): string;
|
|
|
694
580
|
* @param caseSensitive - Whether the search should be case-sensitive (default: true)
|
|
695
581
|
* @returns The resulting string or array of strings after removal
|
|
696
582
|
*
|
|
697
|
-
* @
|
|
698
|
-
*
|
|
699
|
-
* remove("foo", "foobar"); -> "bar"
|
|
700
|
-
* remove(["foo", "bar"], "foobar"); -> ""
|
|
583
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#remove
|
|
701
584
|
*/
|
|
702
585
|
export declare function remove(search: string | Iterable<string>, subject: string | Iterable<string>, caseSensitive?: boolean): string | string[];
|
|
703
586
|
/**
|
|
@@ -706,11 +589,7 @@ export declare function remove(search: string | Iterable<string>, subject: strin
|
|
|
706
589
|
* @param value - The string to reverse
|
|
707
590
|
* @returns The reversed string
|
|
708
591
|
*
|
|
709
|
-
* @
|
|
710
|
-
*
|
|
711
|
-
* reverse("hello"); -> "olleh"
|
|
712
|
-
* reverse("world"); -> "dlrow"
|
|
713
|
-
* reverse(""); -> ""
|
|
592
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#reverse
|
|
714
593
|
*/
|
|
715
594
|
export declare function reverse(value: string): string;
|
|
716
595
|
/**
|
|
@@ -720,11 +599,7 @@ export declare function reverse(value: string): string;
|
|
|
720
599
|
* @param prefix - The prefix to ensure at the start
|
|
721
600
|
* @returns The resulting string starting with the prefix
|
|
722
601
|
*
|
|
723
|
-
* @
|
|
724
|
-
*
|
|
725
|
-
* start("test/string", "/"); -> "/test/string"
|
|
726
|
-
* start("/test/string", "/"); -> "/test/string"
|
|
727
|
-
* start("//test/string", "/"); -> "/test/string"
|
|
602
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#start
|
|
728
603
|
*/
|
|
729
604
|
export declare function start(value: string, prefix: string): string;
|
|
730
605
|
/**
|
|
@@ -733,10 +608,7 @@ export declare function start(value: string, prefix: string): string;
|
|
|
733
608
|
* @param value - The string to convert
|
|
734
609
|
* @returns The converted string in headline case
|
|
735
610
|
*
|
|
736
|
-
* @
|
|
737
|
-
*
|
|
738
|
-
* headline("foo bar baz"); -> "Foo Bar Baz"
|
|
739
|
-
* headline("foO bAr BaZ"); -> "Foo Bar Baz"
|
|
611
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#headline
|
|
740
612
|
*/
|
|
741
613
|
export declare function headline(value: string): string;
|
|
742
614
|
/**
|
|
@@ -745,12 +617,8 @@ export declare function headline(value: string): string;
|
|
|
745
617
|
* @param value - The string to convert
|
|
746
618
|
* @returns The converted string in APA title case
|
|
747
619
|
*
|
|
620
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#apa
|
|
748
621
|
* @see https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case
|
|
749
|
-
*
|
|
750
|
-
* @example
|
|
751
|
-
*
|
|
752
|
-
* apa("foo bar baz"); -> "Foo Bar Baz"
|
|
753
|
-
* apa("foO bAr BaZ"); -> "Foo Bar Baz"
|
|
754
622
|
*/
|
|
755
623
|
export declare function apa(value: string): string;
|
|
756
624
|
/**
|
|
@@ -759,6 +627,8 @@ export declare function apa(value: string): string;
|
|
|
759
627
|
* @param value - The string to convert
|
|
760
628
|
* @param delimiter - The word delimiter to use (default: "_")
|
|
761
629
|
* @returns The converted string in snake case
|
|
630
|
+
*
|
|
631
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#snake
|
|
762
632
|
*/
|
|
763
633
|
export declare function snake(value: string, delimiter?: string): string;
|
|
764
634
|
/**
|
|
@@ -767,13 +637,8 @@ export declare function snake(value: string, delimiter?: string): string;
|
|
|
767
637
|
* @param value - The string to process
|
|
768
638
|
* @returns The resulting string with extra spaces removed
|
|
769
639
|
*
|
|
770
|
-
* @
|
|
771
|
-
|
|
772
|
-
* squish(`
|
|
773
|
-
foo
|
|
774
|
-
bar
|
|
775
|
-
`); -> "foo bar"
|
|
776
|
-
*/
|
|
640
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#squish
|
|
641
|
+
*/
|
|
777
642
|
export declare function squish(value: string): string;
|
|
778
643
|
/**
|
|
779
644
|
* Determine if a given string starts with a given substring.
|
|
@@ -782,10 +647,7 @@ export declare function squish(value: string): string;
|
|
|
782
647
|
* @param needles - The substring or substrings to search for
|
|
783
648
|
* @returns True if the haystack starts with any of the needles, false otherwise
|
|
784
649
|
*
|
|
785
|
-
* @
|
|
786
|
-
*
|
|
787
|
-
* startsWith("hello world", "hello"); -> true
|
|
788
|
-
* startsWith("hello world", "world"); -> false
|
|
650
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#startsWith
|
|
789
651
|
*/
|
|
790
652
|
export declare function startsWith(haystack: string | number | null, needles: string | number | null | Iterable<string | number | null>): boolean;
|
|
791
653
|
/**
|
|
@@ -795,9 +657,7 @@ export declare function startsWith(haystack: string | number | null, needles: st
|
|
|
795
657
|
* @param needles - The substring or substrings to search for
|
|
796
658
|
* @returns True if the haystack doesn't start with any of the needles, false otherwise
|
|
797
659
|
*
|
|
798
|
-
* @
|
|
799
|
-
*
|
|
800
|
-
* expect(doesntStartWith("jason", ["day"])).toBe(true);
|
|
660
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#doesntstartwith
|
|
801
661
|
*/
|
|
802
662
|
export declare function doesntStartWith(haystack: string | number | null, needles: string | number | null | Iterable<string | number | null>): boolean;
|
|
803
663
|
/**
|
|
@@ -806,11 +666,7 @@ export declare function doesntStartWith(haystack: string | number | null, needle
|
|
|
806
666
|
* @param value - The string to convert
|
|
807
667
|
* @returns The converted string in studly caps case
|
|
808
668
|
*
|
|
809
|
-
* @
|
|
810
|
-
*
|
|
811
|
-
* studly("fooBar"); -> "FooBar"
|
|
812
|
-
* studly("foo_bar"); -> "FooBar"
|
|
813
|
-
* studly("foo-barBaz"); -> "FooBarBaz"
|
|
669
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#studly
|
|
814
670
|
*/
|
|
815
671
|
export declare function studly(value: string): string;
|
|
816
672
|
/**
|
|
@@ -818,6 +674,8 @@ export declare function studly(value: string): string;
|
|
|
818
674
|
*
|
|
819
675
|
* @param value - The string to convert
|
|
820
676
|
* @returns The converted string in Pascal case
|
|
677
|
+
*
|
|
678
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#pascal
|
|
821
679
|
*/
|
|
822
680
|
export declare function pascal(value: string): string;
|
|
823
681
|
/**
|
|
@@ -827,15 +685,7 @@ export declare function pascal(value: string): string;
|
|
|
827
685
|
* @param subject - The string to perform replacements on
|
|
828
686
|
* @returns The resulting string after replacements
|
|
829
687
|
*
|
|
830
|
-
* @
|
|
831
|
-
*
|
|
832
|
-
* swap(
|
|
833
|
-
* {
|
|
834
|
-
* 'foo': 'bar',
|
|
835
|
-
* 'baz': 'qux',
|
|
836
|
-
* },
|
|
837
|
-
* 'foo baz'
|
|
838
|
-
* ); -> 'bar qux'
|
|
688
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#swap
|
|
839
689
|
*/
|
|
840
690
|
export declare function swap(map: Record<string, string>, subject: string): string;
|
|
841
691
|
/**
|
|
@@ -845,10 +695,7 @@ export declare function swap(map: Record<string, string>, subject: string): stri
|
|
|
845
695
|
* @param limit - The number of characters to take (negative for from end)
|
|
846
696
|
* @returns The resulting substring
|
|
847
697
|
*
|
|
848
|
-
* @
|
|
849
|
-
*
|
|
850
|
-
* take("hello world", 5); -> "hello"
|
|
851
|
-
* take("hello world", -5); -> "world"
|
|
698
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#take
|
|
852
699
|
*/
|
|
853
700
|
export declare function take(value: string, limit: number): string;
|
|
854
701
|
/**
|
|
@@ -857,9 +704,7 @@ export declare function take(value: string, limit: number): string;
|
|
|
857
704
|
* @param value - The string to process
|
|
858
705
|
* @returns The resulting string with the first character in lowercase
|
|
859
706
|
*
|
|
860
|
-
* @
|
|
861
|
-
*
|
|
862
|
-
* lcfirst('Hello World'); -> 'hello World'
|
|
707
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#lcfirst
|
|
863
708
|
*/
|
|
864
709
|
export declare function lcfirst(value: string): string;
|
|
865
710
|
/**
|
|
@@ -868,9 +713,7 @@ export declare function lcfirst(value: string): string;
|
|
|
868
713
|
* @param value - The string to process
|
|
869
714
|
* @returns The resulting string with the first character in uppercase
|
|
870
715
|
*
|
|
871
|
-
* @
|
|
872
|
-
*
|
|
873
|
-
* ucfirst('hello world'); -> 'Hello world'
|
|
716
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#ucfirst
|
|
874
717
|
*/
|
|
875
718
|
export declare function ucfirst(value: string): string;
|
|
876
719
|
/**
|
|
@@ -879,11 +722,7 @@ export declare function ucfirst(value: string): string;
|
|
|
879
722
|
* @param value - The string to split
|
|
880
723
|
* @returns An array of string segments split at uppercase characters
|
|
881
724
|
*
|
|
882
|
-
* @
|
|
883
|
-
*
|
|
884
|
-
* ucsplit('laravelPHPFramework'); -> ['laravel', 'P', 'H', 'P', 'Framework']
|
|
885
|
-
* ucsplit('Laravel-phP-framework'); -> ['Laravel-ph', 'P-framework']
|
|
886
|
-
* ucsplit('ÖffentlicheÜberraschungen'); -> ['Öffentliche', 'Überraschungen']
|
|
725
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#ucsplit
|
|
887
726
|
*/
|
|
888
727
|
export declare function ucsplit(value: string): string[];
|
|
889
728
|
/**
|
|
@@ -893,11 +732,7 @@ export declare function ucsplit(value: string): string[];
|
|
|
893
732
|
* @param separators - The word separators to use (default: whitespace characters)
|
|
894
733
|
* @returns The resulting string with each word capitalized
|
|
895
734
|
*
|
|
896
|
-
* @
|
|
897
|
-
*
|
|
898
|
-
* ucwords('hello world'); -> 'Hello World'
|
|
899
|
-
* ucwords('laravel php framework'); -> 'Laravel Php Framework'
|
|
900
|
-
* ucwords('Öffentliche Überraschungen'); -> 'Öffentliche Überraschungen'
|
|
735
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#ucwords
|
|
901
736
|
*/
|
|
902
737
|
export declare function ucwords(value: string, separators?: string | string[]): string;
|
|
903
738
|
/**
|
|
@@ -907,10 +742,7 @@ export declare function ucwords(value: string, separators?: string | string[]):
|
|
|
907
742
|
* @param characters - Additional characters to consider as part of words
|
|
908
743
|
* @returns The word count in the string
|
|
909
744
|
*
|
|
910
|
-
* @
|
|
911
|
-
*
|
|
912
|
-
* wordCount('Hello, world!'); -> 2
|
|
913
|
-
* wordCount('мама мыла раму'); -> 3
|
|
745
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#wordcount
|
|
914
746
|
*/
|
|
915
747
|
export declare function wordCount(value: string, characters?: string | null): number;
|
|
916
748
|
/**
|
|
@@ -922,11 +754,7 @@ export declare function wordCount(value: string, characters?: string | null): nu
|
|
|
922
754
|
* @param cutLongWords - Whether to cut words longer than the limit (default: false)
|
|
923
755
|
* @returns The resulting wrapped string
|
|
924
756
|
*
|
|
925
|
-
* @
|
|
926
|
-
*
|
|
927
|
-
* wordWrap("Hello World", 3, "<br />"); -> "Hello<br />World"
|
|
928
|
-
* wordWrap("Hello World", 3, "<br />", true); -> "Hel<br />lo<br />Wor<br />ld"
|
|
929
|
-
* wordWrap("❤Multi Byte☆❤☆❤☆❤", 3, "<br />"); -> "❤Multi<br />Byte☆❤☆❤☆❤"
|
|
757
|
+
* @see https://tolki.abe.dev/strings/string-utilities-list.html#wordwrap
|
|
930
758
|
*/
|
|
931
759
|
export declare function wordWrap(value: string, characters?: number, breakStr?: string, cutLongWords?: boolean): string;
|
|
932
760
|
/**
|