想用逗号分隔绑定字符串 [英] want to bind string using comma separated
问题描述
的字符串JSON = QUOT; [
{
"的ParentId":" a9764da3147845c184bd272cef6a5937" ;,
"路径":" ; / LMS / Cabinet / bdc2cd8e1da3451c84e332d1aa74f605",
" CreatedBY":" admin",
" IsActive":" Y",
CabinetName:LMS,
" FolderTag":IT mobile computing,Comm Skills,
" Name":" ; JAVA",
" UpdatedBY":"",
" Type":" Folder",
" IsDelete":" N",
" UpdatedON":"",
" Id":" bdc2cd8e1da3451c84e332d1aa74f605",
" CreatedON":" 2015_09_08-11:19:50",
" TemplateId":" dd42c8a71a954c1d948ef35492ee1242"
},
{
&q uot; ParentId":" a9764da3147845c184bd272cef6a5937",
" Path":" / LMS / Cabinet / 3aae020c256f4dc1ab705af67bede2c7",
" CreatedBY":" admin" ,
IsActive:Y,
" CabinetName":LMS,
" FolderTag": IT移动计算,通信技能,
"名称":Spring,
" UpdatedBY":"",
" Type":" Folder",
" IsDelete":" N",
" UpdatedON":"",
"标识":" 3aae020c256f4dc1ab705af67bede2c7" ;,
" CreatedON":" 2015_09_04-16:58:05" ;,
TemplateId:" dd42c8a71a954c1d948ef35492ee1242"
},
{
" ParentId":" a9764da3147845c184bd272cef6a5937 " ;,
"路径":" / LMS /柜/ c139b33a22a94a25bf624b94450aee3e" ;,
" CreatedBY":"管理员" ;,
" IsActive":" Y" ;,
" CabinetName":" LMS" ;,
" FolderTag":"社会技能",
" Name":" SQL",
" UpdatedBY":"",
" Type":"文件夹,
" IsDelete":" N",
" UpdatedON":"",
" Id" ;:c139b33a22a94a25bf624b94450aee3e,
" CreatedON":2015_09_04-16:54:44",
" TemplateId":dd42c8a71a954c1d948ef35492ee1242"
}
]"
这是我的json字符串,我只希望名字逗号分隔成另一个变量的字段...
例如:字符串res = {" JAVA"," SPRING"," SQL",... }
就像那个plz给我解决方案
var objdata =
.parseJSON(json);
在objdata中,您将获得使用for循环的所有值,获取索引6中的值,这是名称
string json="[
{
"ParentId":"a9764da3147845c184bd272cef6a5937",
"Path":"/LMS/Cabinet/bdc2cd8e1da3451c84e332d1aa74f605",
"CreatedBY":"admin",
"IsActive":"Y",
"CabinetName":"LMS",
"FolderTag":"IT mobile computing,Comm Skills",
"Name":"JAVA",
"UpdatedBY":"",
"Type":"Folder",
"IsDelete":"N",
"UpdatedON":"",
"Id":"bdc2cd8e1da3451c84e332d1aa74f605",
"CreatedON":"2015_09_08-11:19:50",
"TemplateId":"dd42c8a71a954c1d948ef35492ee1242"
},
{
"ParentId":"a9764da3147845c184bd272cef6a5937",
"Path":"/LMS/Cabinet/3aae020c256f4dc1ab705af67bede2c7",
"CreatedBY":"admin",
"IsActive":"Y",
"CabinetName":"LMS",
"FolderTag":"IT mobile computing,Comm Skills",
"Name":"Spring",
"UpdatedBY":"",
"Type":"Folder",
"IsDelete":"N",
"UpdatedON":"",
"Id":"3aae020c256f4dc1ab705af67bede2c7",
"CreatedON":"2015_09_04-16:58:05",
"TemplateId":"dd42c8a71a954c1d948ef35492ee1242"
},
{
"ParentId":"a9764da3147845c184bd272cef6a5937",
"Path":"/LMS/Cabinet/c139b33a22a94a25bf624b94450aee3e",
"CreatedBY":"admin",
"IsActive":"Y",
"CabinetName":"LMS",
"FolderTag":"Social Skills",
"Name":"SQL",
"UpdatedBY":"",
"Type":"Folder",
"IsDelete":"N",
"UpdatedON":"",
"Id":"c139b33a22a94a25bf624b94450aee3e",
"CreatedON":"2015_09_04-16:54:44",
"TemplateId":"dd42c8a71a954c1d948ef35492ee1242"
}
] "
this is my json string and i want to only "Name" field with comma separated into another variable...
example: string res={"JAVA","SPRING","SQL",...}
like that plz give me solution
var objdata =
.parseJSON(json);
In objdata you will get all the values in which using for loop, get the values in the index 6, which is name
这篇关于想用逗号分隔绑定字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!