vbnet Clean Class

Public Class Clean
Public Property Data As String
Private objRegEx As Regex
Public Sub AlphaNumeric()
'AlphaNumeric whitelist
objRegEx = New Regex("[^-a-zA-Z0-9-_ ]")
Data = objRegEx.Replace(Data, "")
End Sub
Public Sub MaxLength(ByVal Length As Int32)
'trims a string to a specified length
If Data.Length > Length Then
Data = Left(Data, Length)
End If
End Sub
End Class

Basic implementation of a Clean Class, for expanding with methods for various Regular Expressions.

Please use all code snippets with extreme caution.
Although most have been tested working successfully, ensure you make backups before using them.
Slickhouse takes no responsibility for any loss or damage as a result of using these Snippets.