Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如何将字符串保存到数组中。这是一个初学者问题,但我真的需要帮助。提前致谢。
字符串数组以多种方式创建。在 VB.NET 语言中,您可以在初始化语句中创建包含所有数据的数组。例如:
Dim arrayName() As String = {"string1", "string2", "string3"}
您可以预先分配数组,然后分别为其内存位置分配值。例如:
Dim newArray(0 to 2) As String newArray(0) = "string1" newArray(1) = "string2" newArray(2) = "string3"