G
Guest
Hi,
in our application we use the following code snippet:
Dim target As String = Replace(txtLinkTarget.Text, "<SEP>", "'")
If target.StartsWith("(") AndAlso target.EndsWith(")") Then
In line 1 the text-value of of a textbox is retrieved. All occurences of
<SEP> are then replaced by an apostrophe.
However, if txtLinkTarget.Text returns an empty string, the Replace
function evaluates to Nothing, giving me a nice exception in line 2.
How is that possible?
in our application we use the following code snippet:
Dim target As String = Replace(txtLinkTarget.Text, "<SEP>", "'")
If target.StartsWith("(") AndAlso target.EndsWith(")") Then
In line 1 the text-value of of a textbox is retrieved. All occurences of
<SEP> are then replaced by an apostrophe.
However, if txtLinkTarget.Text returns an empty string, the Replace
function evaluates to Nothing, giving me a nice exception in line 2.
How is that possible?