Differences between VB, net-CSTR and Str

Source: Internet
Author: User
To put it simply:
CSTR (10.3) = "10.3" STR (10.3) = "10.3"
CSTR (-10.3) = "-10.3" STR (-10.3) = "-10.3"

If you use STR to convert a positive number to a numeric string
During bit-by-bit processing, the number of cycles is once more.

In addition:
According to msdn, the following CSTR parameters are generally of a wide range of types: Boolean, date, empty, and numeric values can be converted to strings.
The post-str parameter is usually a numerical value.
However, based on the actual test, it is not necessary.
See the following example:
    Private sub commandementclick ()
        Dim t as Boolean
        Print STR (t)   'Output false (with spaces in front)
        Print CSTR (t)  'Output false (no space in front)
    End sub
The output result is:
False
False

Therefore, STR will always add a digit before the parameter to store the symbol bit. Of course, if the parameter is negative and it already contains a negative number, it will not be added.
For example, STR ("-10.3") = "-10.3"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.