lua如何合并俩个table?
table1={[278366651]={xuhao="1",qufu="31",zhanghao="278366651",mima="aa031221",richang...
table1={
[278366651]={xuhao="1",qufu="31",zhanghao="278366651",mima="aa031221",richang="finish"},
[278366652]={xuhao="2",qufu="22",zhanghao="278366652",mima="aa031222",richang="finish"}
}
table2={
[278366653]={xuhao="3",qufu="23",zhanghao="278366653",mima="aa031223",richang="finish"}
}
如何合并2个table,使得table1={
[278366651]={xuhao="1",qufu="31",zhanghao="278366651",mima="aa031221",richang="finish"},
[278366652]={xuhao="2",qufu="22",zhanghao="278366652",mima="aa031222",richang="finish"}
[278366653]={xuhao="3",qufu="23",zhanghao="278366653",mima="aa031223",richang="finish"}
}
}
主要是不知道怎么获取第二个表的,key,278366653.。。。初学,搞晕了 展开
[278366651]={xuhao="1",qufu="31",zhanghao="278366651",mima="aa031221",richang="finish"},
[278366652]={xuhao="2",qufu="22",zhanghao="278366652",mima="aa031222",richang="finish"}
}
table2={
[278366653]={xuhao="3",qufu="23",zhanghao="278366653",mima="aa031223",richang="finish"}
}
如何合并2个table,使得table1={
[278366651]={xuhao="1",qufu="31",zhanghao="278366651",mima="aa031221",richang="finish"},
[278366652]={xuhao="2",qufu="22",zhanghao="278366652",mima="aa031222",richang="finish"}
[278366653]={xuhao="3",qufu="23",zhanghao="278366653",mima="aa031223",richang="finish"}
}
}
主要是不知道怎么获取第二个表的,key,278366653.。。。初学,搞晕了 展开
展开全部
for k,v in pairs(table2) do
table1[k] = v
end
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询