- Home /
Question by
vvcc · Mar 13, 2018 at 06:37 PM ·
javascriptarraystringconvertwrite data
convert string to array to write to document
I have a string that looks like this:
str = "{ "number" : "1", "street" : "one"}, { "number" : "2", "street" : "two" }, { "number" : "3", "street" : "three" }, { "number" : "4", "street" : "four" }, ...etc }";
and I'm writing it to a document like so:
var sw = new StreamWriter("mydoc.doc");
sw.Write(str);
Is there a way I can convert the string into an array, before it gets written to the doc? So that it can fit into an excel sheet nicely?
Comment
You could perhaps split on }
var array = str.Split('}');
Your answer
Follow this Question
Related Questions
Convert String to GameObject[] type Array 2 Answers
Convert Javascript class to a string 0 Answers
String Parsing 1 Answer
More like a bulletin than chat box 0 Answers
Get JSON array object string value 2 Answers