[Solved] Regex to match given string filenames in a string

[ad_1] This one should work exactly for first two files, but won’t work if there any additional special characters in file names: using System; using System.Collections.Generic; using System.Text.RegularExpressions; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { const string example = “PrintFileURL(\”13572_IndividualInformationReportDelta_2012-06-29_033352.zip\”,\”13572_IndividualInformationReportDelta_2012-06-29_033352.zip\”,0,\”53147\”,\”Jun 29 3:33\”,\”/icons/default.gif\”)”; Console.WriteLine(example); const string pattern = “\\\”([a-zA-Z0-9\\-_]*?\\..*?)\\\””; var regex = … Read more

[Solved] joins on multiple keys in linq [closed]

[ad_1] Try code like this using System.Collections.ObjectModel; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace ConsoleApplication57 { class Program { static void Main(string[] args) { int employeeId = 113; List<E_JOURNAL> employee = E_JOURNAL.journals.Where(x => x.JOURNALID == employeeId).ToList(); var results = (from j in employee join s in E_ABSENCE.absenses on j.JOURNALID equals s.JOURNALID … Read more

[Solved] c++ merge sort trouble [closed]

[ad_1] So one small mistake that you don’t take into account is that, you are passing pointer array ini but inside the method you still use the method initial and one more thing is, you should take in a temp array that would assign the sorted values to your ini array. So your code should … Read more

[Solved] 2D array Seating Chart C++ [closed]

[ad_1] If I choose seat # 1 and Row # 1 it makes the mark on the chart at seat and row #2… The problem is that arrays in C start with index 0, so the left most seat has index 0, not 1. Thus, if you enter 1 into row2, and write map[row2][column2] = … Read more

[Solved] C# If statement calling a method not working?

[ad_1] if (bigList[0][0] == ” “) This is true because the value of bigList[0][0] is also ” “, and the strings are compared by their value. Since they have the same value, the comparison is true. if (bigList[0] == smallList) This is true because bigList[0] points to the same object in memory as smallList does. … Read more

[Solved] Why does the difference emerge between this two codes in C: Array Implementation for Stack and Linked List Implementation for Stack?

[ad_1] Why does the difference emerge between this two codes in C: Array Implementation for Stack and Linked List Implementation for Stack? [ad_2] solved Why does the difference emerge between this two codes in C: Array Implementation for Stack and Linked List Implementation for Stack?

[Solved] error message of no suitable user-defined conversion [closed]

[ad_1] You need to use the correct type which is decltype(temp)::iterator ptr1 = temp.begin(); – that is, ptr1 is a std::string::iterator, not a std::vector<std::string>::iterator. So for your snippet to compile, change std::vector<std::string>::iterator ptr1 = temp.begin(); to auto ptr1 = temp.begin(); // ptr1 is a std::string::iterator 2 [ad_2] solved error message of no suitable user-defined conversion … Read more

[Solved] Regex to remove specific params from tags [closed]

[ad_1] HEIGHT: \d+[^;]+; will match HEIGHT: 218px; in <body style=”HEIGHT: 218px; margin: 0px; background-color: #ffffff;” jQuery111105496473080628138=”10″> Something like this could get you going: (HEIGHT:\s*\d{1,}[^;]*;)(?<=<body.*style=”[^”]*)(?=[^”].*”\s*>) Which ~translates~ to : Capture: (HEIGHT:\s*\d{1,}[^;]*;) If preceded by: (?<=<body.*style=”[^”]*) And followed by: (?=[^”].*”\s*>) Implemented in code: using System; using System.Collections.Generic; using System.Text.RegularExpressions; static void Main(string[] args) { string string1 = … Read more

[Solved] How can i read from a text file line by line and add those strings to an array? [closed]

[ad_1] The array isnt initialized. Try using List instead of array. private void button2_Click(object sender, EventArgs e) { List<int> citaj = new List<int>(); string h; using(System.IO.StreamReader sr = new System.IO.StreamReader(@”text\brojac.txt”)) { while ((h = sr.ReadLine()) != null) { int number = 0; if (int.TryParse(h, out number)) citaj.Add(number); } } } [ad_2] solved How can i … Read more

[Solved] how to download gridview in excel in ASP.NET C #, ie How to use group by in datatable

[ad_1] Ugh, be prepared for an accident that makes a mess of your data with this “associated by position” idea I wouldn’t use LINQ for this either var l = new List<string>(); string prev = null; foreach(DataRow r in dt.Rows){ var s = (string)r[“Column1”]; var t = (string)r[“Column2”]; if(s != prev){ l.Add(s); prev = s; … Read more