I have this string that I am trying to add quotes “” around text that meets certain requirements. The rule is Add “” to the word(s) following ‘Text:’ and before ‘;’ or ‘}’
Here is the string: EDIT(notice the “”. This is not a JSON Object. Its just a string) :
var str = "View_1:{
Name:"View1";
Image_1:{
BackgroundImage:"Image.gif";
Position: [0, 0];
Text: 320;
Height: 480
},
Button_1:{
BackgroundImage:"Button.gif";
Transition:"View2";
Position: [49, 80];
Width: 216;
Height: 71;
Text: more text more
},
Button_2:{
BackgroundImage:"Button2.gif";
Position: [65, 217];
Width: 188;
Text:Some Text;
Height: 134
},
}"
I cant get it to work
Try this:
Though I have my doubts about
strbeing a string in your question. It looks more like (an invalid) JSON object than a string.