how to separate strings from string in c# -
this question has answer here:
in c# program have 1 string this.
string ss = [["karoline,ejlstrupvej 90 90, 4100, ringsted,07:50:00,55.48148, 11.78890","karoline,ejlstrupvej 101, 4100, ringsted,07:50:00,55.47705, 11.78523","byskovskolen, prstevej 19, 4100, ringsted,55.46842, 11.80975"],["mads,sdr. parkvej 27, 4100, ringsted,08:00:00,55.44648, 11.78757","niels,fluebækvej 204, 4100, ringsted,08:00:00,55.44295, 11.79137","heldagsskolen specialtilbud, vestervej 27, 4100, ringsted,55.44050, 11.78115"]];
how can separate values this.
["karoline,ejlstrupvej 90 90, 4100, ringsted,07:50:00,55.48148, 11.78890","karoline,ejlstrupvej 101, 4100, ringsted,07:50:00,55.47705, 11.78523","byskovskolen, prstevej 19, 4100, ringsted,55.46842, 11.80975"] ["mads,sdr. parkvej 27, 4100, ringsted,08:00:00,55.44648, 11.78757","niels,fluebækvej 204, 4100, ringsted,08:00:00,55.44295, 11.79137","heldagsskolen specialtilbud, vestervej 27, 4100, ringsted,55.44050, 11.78115"]
i trying
ss.split('],[');
but takes single character, not able split strings.
use javascriptserializer
since string close json.
var listoflists = new javascriptserializer().deserialize <list<list<string>>>(str);
and you'll 2 lists each having 3 items string's formatted version implies
[ [ "karoline,ejlstrupvej 90 90, 4100, ringsted,07:50:00,55.48148, 11.78890", "karoline,ejlstrupvej 101, 4100, ringsted,07:50:00,55.47705, 11.78523", "byskovskolen, prstevej 19, 4100, ringsted,55.46842, 11.80975" ], [ "mads,sdr. parkvej 27, 4100, ringsted,08:00:00,55.44648, 11.78757", "niels,fluebækvej 204, 4100, ringsted,08:00:00,55.44295, 11.79137", "heldagsskolen specialtilbud, vestervej 27, 4100, ringsted,55.44050, 11.78115" ] ]
Comments
Post a Comment