How to declare a fixed-length string in VB.NET?

前端 未结 10 3020
醉酒成梦
醉酒成梦 2020-12-10 04:27

How do i Declare a string like this:

Dim strBuff As String * 256

in VB.NET?

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-10 04:56

    Try this:

        Dim strbuf As New String("A", 80)
    

    Creates a 80 character string filled with "AAA...."'s

    Here I read a 80 character string from a binary file:

        FileGet(1,strbuf)
    

    reads 80 characters into strbuf...

提交回复
热议问题