I've got a bunch of duplicate code that looks like this:
If mValue is Nothing Return ""
Return mValue.ToUpper
I defined the following extension method to reduce duplicate code:
<System.Runtime.CompilerServices.Extension()>
Public Function EmptyIfNull(this As String) As String
If String.IsNullOrEmpty(this) Then Return ""
Return this
End Function
The duplicate code can be re-written as:
Return mValue.EmptyIfNull.ToUpper
Is there a downside to this?