因为所有的搜索引擎包括csdn的全文搜索搜索str$的时候都自动去掉$的搜索,所以我无法找到有用的信息。所以现在到社区来提问了。
我将在今晚线关注这个问题。
希望大家能够帮助我,谢谢!

解决方案 »

  1.   

    功能和str差不多,据说是str$处理双字节字符串比较好
      

  2.   

    首先谢谢楼上的朋友。
    我来举一个例子,比如说这几行代码,为什么结果是4而不是6?a="abc"
    b="cde"
    z=len(str$(a)+str$(b))
    print z
      

  3.   

    Str$定义:
    Function Str$(Number) As String
      

  4.   

    junki(『打破沙锅问到底』) 朋友说得很明白了,看定义
    将非string类型转换为string类型
      

  5.   

    看msdn啊。
    Str 函数
          返回代表一数值的 Variant (String)。语法Str(number)必要的 number 参数为一 Long,其中可包含任何有效的数值表达式。说明当一数字转成字符串时,总会在前头保留一空位来表示正负。如果 number 为正,返回的字符串包含一前导空格暗示有一正号。使用 Format 函数可将数值转成必要的格式,如日期、时间、货币或其他用户自定义格式。与 Str 不同的是,Format 函数不包含前导空格来放置 number 的正负号。注意   Str 函数只视句点 (.) 为有效的小数点。如果使用不同的小数点(例如,国际性的应用程序),可使用 CStr 将数字转成字符串。
      

  6.   

    首先谢谢楼上的朋友。
    我来举一个例子,比如说这几行代码,为什么结果是4而不是6?a="abc"
    b="cde"
    z=len(str$(a)+str$(b))
    print z==========
    VB会自动转换变量类型
      

  7.   

    a="abc"
    b="cde"
    z=len(str$(a)+str$(b))
    print z==========================================
    这样是运行不了地,str$中只接受数值型的参数。
      

  8.   

    没看清下面的内容,汗a="abc"
    b="cde"
    z=len(str$(a)+str$(b))
    print z
      

  9.   

    Returns a Variant (String) representation of a number.SyntaxStr(number)The required number argument is a Long containing any valid numeric expression.ResWhen numbers are converted to strings, a leading space is always reserved for the sign of number. If number is positive, the returned string contains a leading space and the plus sign is implied.Use the Format function to convert numeric values you want formatted as dates, times, or currency or in other user-defined formats. Unlike Str, the Format function doesn't include a leading space for the sign of number.Note   The Str function recognizes only the period (.) as a valid decimal separator. When different decimal separators may be used (for example, in international applications), use CStr to convert a number to a string.MSDN的介绍 很详细的。
      

  10.   

    首先谢谢楼上的朋友。
    我来举一个例子,比如说这几行代码,为什么结果是4而不是6?a="abc"
    b="cde"
    z=len(str$(a)+str$(b))
    print z==========
    如果这样可以的话,那原因是因为VB内部默认为Unicode编码;两个字符占一位。猜的。
      

  11.   

    另:$符号一般是为了兼容低版本。$表示结果是字符串。还有其他的缩写形式的。
    比如定义变量:
    s$="string2"
      

  12.   

    已經是字符串,為什麼還要用str$
      

  13.   

    这句 z=len(str$(a)+str$(b)) 是要干什么?
    如果是将字符串连接起来,改成 z=len(a+b) 吧
    print XX 语句用在哪种版本的Basic中哟?
      

  14.   

    Str$更为严格,它定义了返回值为string
    比方说,你可以不声明变量就可直接使用,但声明有其好处
    在Space,left,right,...之类的函数后加$提高了代码可读性,也不易出错
    此外,这也与VB .NET兼容