Convert.ToInt16 (SByte) converts 8-bit signed integer to 16-bit signed integer.
Module Example
Public Sub Main()
Dim numbers() As SByte = { SByte.MinValue, -1, 0, 10, SByte.MaxValue }
Dim result As Short
For Each number As SByte In numbers
result = Convert.ToInt16(number)
Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.", _
number.GetType().Name, number, _
result.GetType().Name, result)
Next
End Sub
End Module
Related examples in the same category