You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Join some overloads of string methods to union parameters
Fixes the string methods which accept either a string or RegExp as pattern. Also, some help texts were fixed to represent the actual behavior as per spec. See microsoft#5766
* Finds the first substring match in a regular expression search.
398
-
* @param regexp The regular expression pattern and applicable flags.
372
+
* @param regexp The regular expression pattern or object.
399
373
*/
400
-
search(regexp: RegExp): number;
374
+
search(regexp: RegExp | string): number;
401
375
402
376
/**
403
377
* Returns a section of a string.
@@ -409,17 +383,10 @@ interface String {
409
383
410
384
/**
411
385
* Split a string into substrings using the specified separator and return them as an array.
412
-
* @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
413
-
* @param limit A value used to limit the number of elements returned in the array.
* Split a string into substrings using the specified separator and return them as an array.
419
-
* @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
386
+
* @param separator A literal string or a regular expression object that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
420
387
* @param limit A value used to limit the number of elements returned in the array.
0 commit comments