Please help urgent Conversion of string to array
-
this is in C# string q = " {label:\"January\",value:\"1\" } , {label:\"Feburary\",value:\"2\"}"; i want to convert this into an array in javascript function(data){ this is where i need array data is nothing but string q } Please help urgent Chandra Sekhar
-
this is in C# string q = " {label:\"January\",value:\"1\" } , {label:\"Feburary\",value:\"2\"}"; i want to convert this into an array in javascript function(data){ this is where i need array data is nothing but string q } Please help urgent Chandra Sekhar
IE String Object (literal) (JScript) Allows manipulation and formatting of text strings and determination and location of substrings within strings. String is not a collection and not array. Use operator + or method concat. To convert a JScript-string into array use method split. To convert a numeric value into String use method parseInt. Syntax newString = new String(["stringLiteral"]) Arguments newString Required. The variable name to which the String object is assigned. stringLiteral Optional. Any group of Unicode characters. Remarks String objects can be created implicitly using string literals. String objects created in this fashion (referred to as standard strings) are treated differently than String objects created using the new operator. All string literals share a common, global string object. If a property is added to a string literal, it is available to all standard string objects: var alpha, beta; alpha = "This is a string"; beta = "This is also a string"; alpha.test = 10; In the previous example, test is now defined for beta and all future string literals. In the following example, however, added properties are treated differently: var gamma, delta; gamma = new String("This is a string"); delta = new String("This is also a string"); gamma.test = 10; In this case, test is not defined for delta. Each String object declared as a new String object has its own set of members. This is the only case where String objects and string literals are handled differently. Properties constructor length prototype Methods anchor big blink bold charAt charCodeAt concat fixed fontcolor fontsize fromCharCode indexOf italics lastIndexOf link match replace search slice small split strike sub substr substring sup toLowerCase toUpperCase toString valueOf Examples // A primitive string. var string1 = "Hello"; // Two distinct String objects with the same value. var StringObject1 = new String(string1); var StringObject2 = new String(string1); // An object converts to a primitive when // comparing an object and a primitive. print(string1 == StringObject1); // Prints true. // Two distinct objects compare as different. print(StringObject1 == StringObject2); // Prints false. // Use the toString() or valueOf() methods to compare object values. print(StringObject1.valueOf() == StringObject2); // Prints true. length Property (String) Returns the length of a String object. strVariable.length "