D
Derek Martin
I have an object with several string elements that I would like to check for
invalid characters in the properties of each element. Can I use
string.replace to do that or is there a better alternative to this?
Example:
Property orgname() As String
Get
orgname = m_orgname
End Get
Set(ByVal Value As String)
If Value = "" Then Throw New ArgumentException("OrgName cannot be
null or blank")
value.Replace("'", "&&")
value.Replace(";", "&&")
value.replace(",", "&&")
m_orgname = Value
End Set
End Property
Is there an easier way to do this/a way to do it with fewer repetative lines
of code?
Thanks,
Derek
invalid characters in the properties of each element. Can I use
string.replace to do that or is there a better alternative to this?
Example:
Property orgname() As String
Get
orgname = m_orgname
End Get
Set(ByVal Value As String)
If Value = "" Then Throw New ArgumentException("OrgName cannot be
null or blank")
value.Replace("'", "&&")
value.Replace(";", "&&")
value.replace(",", "&&")
m_orgname = Value
End Set
End Property
Is there an easier way to do this/a way to do it with fewer repetative lines
of code?
Thanks,
Derek