This question already has answers here:
How to create a sequence of integers in C#?
(9 answers)
Closed 2 years ago.
I am trying to figure out a way to generate each number between 2 other numbers. For example, if the first number is 7 and the last number is 12 I want to generate an array(?) of Int that would be Intarray {7,8,9,10,11,12}.
Is this possible?
Enumerable.Range(,) will be your friend.
Related
This question already has answers here:
Formatting a large number with commas
(4 answers)
Formatting Large Numbers with .NET
(5 answers)
Closed 1 year ago.
In my program it says the float value for how much currency the person has. Currently if its a huge number say 200,000,000, it displays it as "2E+08" When I would rather it display "200 Million" Any help would be appreciated
This question already has answers here:
Built in .Net algorithm to round value to the nearest 10 interval
(8 answers)
Rounding integers to nearest multiple of 10 [duplicate]
(6 answers)
Closed 2 years ago.
how to round up number upper or lower in the simplest way?
for example
36 >>> 40
33 >>> 30
Check out the documentation for System.Math.Round. You can specify whether you want to round up/down as well as the interval you want to round to.
This question already has answers here:
Algorithm to return all combinations of k elements from n
(77 answers)
What is the best way to find all combinations of items in an array?
(11 answers)
Closed 9 years ago.
Given:
{1,2,3}
Expected result:
{1,2,3},
{1,2},{1,3},{2,3},
{1},{2},{3}
So I want basically ALL possible combinations in a list ( but including all possible combinations of - when every element is removed ).
I hope you get what I mean ;)
Question: Which algorithm achieves this?
You want the power set algorithm.
There are some examples on Rosetta Code.
This question already has answers here:
Total number of items defined in an enum
(10 answers)
Closed 10 years ago.
How to get the count of total values defined in an enumeration?
Enum.GetNames(typeof(SomeEnum)).Length;
This question already has answers here:
Is it possible to pad integers with zeros using regular expressions?
(2 answers)
Closed 9 years ago.
I am trying to display a code like ABC/DEF/00012 or ABC/EDF/01234 or ABC/DEF/00009
I use RegEx mask \w{3}/\w{3}/?????
The question mark is hard part that I could not figure it out.
Basically, I try to display the code with characters and numbers. I want to automatically add leading zeros on the number.
Byron
Seems that you're trying to match 5 digits at the end:
\w{3}/\w{3}/\d{5}