C# List to string with delimiter

You can use String.Join. If you have a List<string> then you can call ToArray first: List<string> names = new List<string>() { “John”, “Anna”, “Monica” }; var result = String.Join(“, “, names.ToArray()); In .NET 4 you don’t need the ToArray anymore, since there is an overload of String.Join that takes an IEnumerable<string>. Results: John, Anna, Monica

Split a string into words by multiple delimiters [duplicate]

Assuming one of the delimiters is newline, the following reads the line and further splits it by the delimiters. For this example I’ve chosen the delimiters space, apostrophe, and semi-colon. std::stringstream stringStream(inputString); std::string line; while(std::getline(stringStream, line)) { std::size_t prev = 0, pos; while ((pos = line.find_first_of(” ‘;”, prev)) != std::string::npos) { if (pos > prev) … Read more

Is it possible to use AngularJS with the Jinja2 template engine?

You have some options. 1) Change the delimiter notation for Angular: var app = angular.module(‘Application’, []); app.config([‘$interpolateProvider’, function($interpolateProvider) { $interpolateProvider.startSymbol(‘{a’); $interpolateProvider.endSymbol(‘a}’); }]); Whatever is chosen for the start and end symbols will act as the new delimiters. In this case, you would express a variable to Angular using {a some_variable a}. This approach has the … Read more