forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathref-return.vb
31 lines (28 loc) · 958 Bytes
/
ref-return.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Module Example
Public Sub Main()
SimpleMethodCall()
Console.WriteLine()
ConditionalModification()
End Sub
Private Sub SimpleMethodCall()
' <Snippet1>
Dim sentence As New Sentence("A time to see the world is now.")
Dim found = False
sentence.FindNext("A", found) = "A good"
Console.WriteLine(sentence.GetSentence())
' The example displays the following output:
' A good time to see the world is now.
' </Snippet1>
End Sub
Private Sub ConditionalModification()
' <Snippet2>
Dim sentence As New Sentence("A time to see the world is now.")
Dim found = False
sentence.FindNext("A", found) = IIf(found, "A good", sentence.FindNext("B", found))
Console.WriteLine(sentence.GetSentence())
' The example displays the following output:
' A good time to see the world is now.
' </Snippet2>
End Sub
End Module