If Option Strict is Off, then (integer)x will implicitly be converted into (string)str.
Example:
Dim intVal As Integer = 5Dim strVal As String = String.EmptystrVal = intValMsgBox(strVal)
But if Option Strict is On, then the (integer)x will not be implicitly converted into (string)str. In this case, we will have to use the conversion function.
Example1:
Dim intVal As Integer = 5Dim strVal As String = String.EmptystrVal = CStr(intVal)MsgBox(strVal)
Example 2:
Dim intVal As Integer = 5Dim strVal As String = String.EmptystrVal = CType(intVal, String)MsgBox(strVal)
0 comments:
Post a Comment