Skip to content

Commit 31e12f7

Browse files
committed
C#: Recognize all overloads of String.Replace as a replace method.
1 parent 0c4e1fc commit 31e12f7

File tree

1 file changed

+2
-2
lines changed
  • csharp/ql/lib/semmle/code/csharp/frameworks

1 file changed

+2
-2
lines changed

csharp/ql/lib/semmle/code/csharp/frameworks/System.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,11 @@ class SystemStringClass extends StringType {
346346
result.hasName("==")
347347
}
348348

349-
/** Gets the `Replace(string/char, string/char)` method. */
349+
/** Gets the `Replace(...)` method. */
350350
Method getReplaceMethod() {
351351
result.getDeclaringType() = this and
352352
result.hasName("Replace") and
353-
result.getNumberOfParameters() = 2 and
353+
result.getNumberOfParameters() in [2 .. 4] and
354354
result.getReturnType() instanceof StringType
355355
}
356356

0 commit comments

Comments
 (0)