score:1
Accepted answer
var userDefinedSeries = {
"style":"normal",
"color":"rgb(0, 0, 255)",
"width":4,
"uid":[["425780c9-9727-4c5d-9bc4-65ce3334b0aa"],["06a8a24e-6a59-43e0-89a4-9fe4db55cac5"],["e1c73a33-ba2c-4d8d-9751-3c336442da84"]],
"data":[[2500,50000],[2500,40000],[3000,40000]],
"product":[["Product 3"],["Product 1"],["Product 2"]],
"name":"Subject Property","type":"scatterLine","$$hashKey":"object:91"};
var newString = [];
var string;
var key = 0;
userDefinedSeries.product.map(function(arrayCell) {
string = arrayCell + "," + userDefinedSeries.data[key];
string = string.replace(" ","-");
newString.push(string);
key++;
});
console.log(newString.join(" | "));
score:1
var newString = [];
var modifiedNames = userDefinedSeries.product.map(function(product, index) {
var productString = product.map(function (p) {
return p.replace(" ", '-');
}).join(' ');
newString.push(productString + ', ' + userDefinedSeries.data[index].join(', '));
});
console.log(newString.join(' | '));
score:1
var newString = "";
for(var i=0; i< userDefinedSeries.uid.length;i++){
newString += userDefinedSeries.product[i];
newString += ","+userDefinedSeries.data[i];
newString += "|";
}
console.log(newString);// your required string
Source: stackoverflow.com
Related Query
- how to convert nested array of arrays into comma separated string
- How to convert list of arrays into a multidimensional array
- How to Convert the value in DataTable into a string array in c#
- Convert Array of Strings to Comma Separated String with additional concatenation
- How to turn array into quote and comma delimited string for sql?
- How to Convert a String into Integer Array in C#
- How would I convert only a subset of column values from a DataRow into a string array using LINQ?
- How to convert IEnumerable<string> to one comma separated string?
- How to convert a 2-d array into a dictionary object
- Easiest way to convert list to a comma separated string by a Specific Property?
- convert comma separated string to list using linq
- How to convert a list of ints to a string array in Linq?
- How to merge an array that was split into 2 arrays with odd and even indices?
- How to Select the Token and Index from a Comma Separated String in Linq
- How to convert Array Objects into another using LINQ?
- How to convert two columns into a single string column with dynamic linq?
- How to partition an array into multiple arrays with LINQ?
- How to check for null values before Converting a comma Separated string to Generic List
- Find index of item from string array containing comma separated values
- How to convert string array to string in Linq to entities?
- How can I convert string into int without enumerating a query
- How do I convert a string array(having xml content) into an XML file?
- How to send column data as a comma separated string from stored procedure?
- When aggregating C# datasets, how do I convert a DataSet into an DataTable Array for .Load()?
- How to Convert a search string into a LINQ Query?
- How to convert a Dictionary containing values as comma seperated strings into a Collection of KeyValuePairs?
- Convert comma separated string to int list and validate
- Use LINQ to convert comma separated strings in a table into a distinct collection of values
- how to convert string into DateTime in where Clause?
- how do i convert Dictionary string string to array of key value pair of string and string using linq and c#
More Query from same tag
- cast to the object for databounditem value
- How can I flatten out data in a list and then get a count of what's in each column using LINQ?
- C# Linq merge multiple lists?
- EF4 Linq - Get top items using criteria from related tables
- C# is there a difference between where() and where<T>()
- Use lambda syntax to retrieve a property from an anonymous type in vb.net
- Generic Interface For Hierarchical Collection
- Why can't I pass an anonymous type as a parameter to a function?
- c# decimal to hex & hex to decimal / hex to ascii in LINQ
- Converting String List to Single Quoted List in C# .NET
- Can I capture a local variable into a LINQ Expression as a constant rather than a closure reference?
- Passing Func to Linq to Entities Sum(..)
- Combining two generics of type Dictionary<string, List<Model>> into another of the same type
- EF Core 3, OrderByDescending and ThenBy rerurn error could not be translated
- C# get nullable datetime ToString format method with params to set Expression.Call
- Entity Framework - Include Multiple Levels of Properties with different subclasses
- How can you tell if an Xnode is of XElement type?
- Nested select with group by using linq
- How to select minimum element without transforming it?
- Linq - select where ancestors contain this?
- Find max and min date from different property
- Lists: Count vs Count()
- Compiled C# Linq Expression<Func<T>> and querying Mongo
- How to write a linq query to select data from two table?
- reading excel via linq, how to cast columns
- Check if XML element exist using LINQ
- GroupBy and Distinct don't work
- LINQ To SQL Join with IEnumerable<Non-Premitive Type>
- Using Array and IEnumerable in an Extension Method
- I want to apply Except between two lists. One list is in MailAddress format and other is a String (Converted to list))