Str Function in VB.NET
String Function in VB.NET ?
Explanation
Str Function
Str() String Function in Visual Basic.net 2008 is used to return string equivalent for the specified integer.
Syntax:
Public Shared Function Str(ByVal Number As Object) As String
In the above syntax
Number specifies a valid numeric expression.
Example:
Module Module1
Sub Main()
Console.WriteLine('String returned for 5.5 is::' & Str(5.5))
Console.WriteLine('String returned for -5.5 is::' & Str(-5.5))
Console.ReadLine()
End Sub
End Module
Result:
String returned for 5.5 is:: 5.5
String returned for -5.5 is::-5.5
In the above example, preceding space is left for positive characters, but a minus is displayed
for negative integers. Thus Str string function can be used.