22 lines
580 B
Plaintext
22 lines
580 B
Plaintext
![]() |
[source,vbnet]
|
||
|
----
|
||
|
Imports System.Diagnostics.CodeAnalysis
|
||
|
Imports System.Runtime.CompilerServices
|
||
|
Imports System.Text.RegularExpressions
|
||
|
|
||
|
Module Program
|
||
|
<Extension>
|
||
|
Function RemoveVowels(Value As String) As String
|
||
|
If Value Is Nothing Then
|
||
|
Return Nothing
|
||
|
End If
|
||
|
Return Regex.Replace(Value, "[aeoui]*", "", RegexOptions.IgnoreCase)
|
||
|
End Function
|
||
|
|
||
|
Sub Main()
|
||
|
Dim StrValue As String = Nothing
|
||
|
Console.WriteLine(StrValue.RemoveVowels()) ' Compliant: 'RemoveVowels' is an extension method
|
||
|
End Sub
|
||
|
End Module
|
||
|
----
|