Str Function |
Microsoft.VisualBasic.Conversion
Str( number )
Any valid numeric expression or expression capable of conversion to a number
A String representation of number
Converts number from a numeric to a string
If number cannot be converted to a string, an InvalidCastException error occurs. To prevent this, you can check the value of number by passing it to the IsNumeric function before calling Str .
If number is not a numeric value or is not capable of conversion to a number (so that it can in turn be converted to a string), an InvalidCastException exception occurs.
If the return value is positive, the Str function always includes a leading space in the returned string for the sign of number .
Use the LTrim function to remove the leading space that the Str function adds to the start of the returned string.
Both the CStr and Format functions have now superceded the Str function. The CStr function does not add a leading space for the sign of a positive number. Both the CStr and the Format functions are internationally aware, able to recognize decimal delimiters other than the period (.).
CStr Function