Skip to main content

Remove Redundant Qualifier

Removes redundant this or base qualifiers.

#Availability

Available from the context menu or via shortcuts:

  • when the cursor is on a redundant this or base qualifier.

#Notes

There is also a Remove Redundant Qualifier (remove all) variant of this refactoring, that removes all redundant qualifiers in the current file.

#Examples

private string MethodName(int i)
{
    return String.Format("i = {0}",i);
}
private void Test()
{
    string str = this.MethodName(15);
}
Private Function MethodName(ByVal i As Integer) As String
    Return String.Format("i = {0}", i)
End Function
Private Sub Test()
    Dim str As String = Me.MethodName(15)
End Sub

Result:

private string MethodName(int i)
{
    return String.Format("i = {0}",i);
}
private void Test()
{
    string str = MethodName(15);
}
Private Function MethodName(ByVal i As Integer) As String
    Return String.Format("i = {0}", i)
End Function
Private Sub Test()
    Dim str As String = MethodName(15)
End Sub

#Screenshot

rsRemoveRedundantQualifier