[Solved] Check string format consist of specific words then number then specific words in c# [closed]

It’s really easy to make a regular expression to get matches: string[] input = new string[6] { “[email protected]”, // match “[email protected]”, // match “[email protected]”, // match “[email protected]”, // not a match “[email protected]”, // not a match “[email protected]” // not a match }; string pattern = @”Auto_gen_\d{4}@mail.com”; //\d{4} means 4 digits foreach (string s in input) … Read more

[Solved] c# foreach loop formatting

Hmmm, I haven’t tested it. I hope it helps you. I would do it using two foreach inside the main while SearchResultSet results = session.Search(searchRequest); results.GetCount()); IEnumerable columns = results.GetColumns(); bool printColumns = true; while (results.HasNext()) { if(printColumns){ foreach (string column in columns) { Console.WriteLine(String.Format(“{0}|”, column)); //Will print Unique_ID|Address|etc… } } printColumns = false; foreach … Read more

[Solved] How to disable enter alphabet symbols in Combobox C#?

You can use Regex As an example In Combobox_TextChanged event if charcter match remove it private void comboBox1_TextChanged(object sender, EventArgs e) { string rex=comboBox1.Text; Regex regex = new Regex(@”^\d$”); if (regex.IsMatch(compare)) { rex= Regex.Replace(rex, @”(?<=\d),(?=\d)|[.]+(?=,)[A-Z]”, “”); } comboBox1.Text=rex; } This can help you. Regex for numbers only 5 solved How to disable enter alphabet symbols … Read more

[Solved] is there a way randomly separate a string into different string array and get back same same string [closed]

Assuming that the request for a “random” allocation of letters to arrays is for a pseudo-random (or, perhaps, a superficially arbitrary) allocation that is therefore reversible, one technique to do this would be to essentially use a transposition cipher. The algorithm would then be something like: Run the transposition cipher on the input text. Split … Read more

[Solved] Most efficient way to concatenate list within list without a loop

List<int> theInts = unicorns.SelectMany(unicorn => unicorn.Numbers).ToList(); Without measuring, the only thing in here that gives me pause from a performance perspective is the .ToList If there are a TON of numbers, it’s possible that ToList may repeatedly re-allocate its backing array. In order to escape this behavior, you have to have some idea about how … Read more

[Solved] How to list all the domains in India under one website based on categories [closed]

You just cannot list 100% of Indian websites. If I understand what you want, you want something like a Web crawler for Indian domains. Another “google”. But even big spiders like Google’s, Yahoo’s, Bing’s spiders can’t build a database of all the websites. They do this with algorithms (with partly published algorithms), but I think … Read more