vb.net 中 两个string()合并
我有2个String():Dimstr1AsString()={"123","321","231","132"}Dimstr2AsString()={"qwe","asd...
我有2个String():Dim str1 As String() = {"123", "321", "231", "132"}Dim str2 As String() = {"qwe", "asd", "zxc", "sdf", "asdf"}
如何把 str1 与str2 合并成新 str() 中。我要的效果是:
Dim str As String() = {"123", "321", "231", "132","qwe", "asd", "zxc", "sdf", "asdf"}
希望给出VB.NET 代码 新手 请多多指教。 展开
如何把 str1 与str2 合并成新 str() 中。我要的效果是:
Dim str As String() = {"123", "321", "231", "132","qwe", "asd", "zxc", "sdf", "asdf"}
希望给出VB.NET 代码 新手 请多多指教。 展开
展开全部
Dim Str1() As String = {"123", "321", "231", "132"}
Dim Str2() As String = {"qwe", "asd", "zxc", "sdf", "asdf"}
Dim Str() As String = Str1
ReDim Preserve Str(Str1.Length + Str2.Length - 1)
Str2.CopyTo(Str, Str1.Length)
Dim Str2() As String = {"qwe", "asd", "zxc", "sdf", "asdf"}
Dim Str() As String = Str1
ReDim Preserve Str(Str1.Length + Str2.Length - 1)
Str2.CopyTo(Str, Str1.Length)
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询