Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
func1 and func 2 are delegates, a type that represent a calling site (a method somewhere).
It's like pointer of function in C/C++, but delegates in C# posses more informations than that (the instance of the object for non static method, ...)
This feature is used in many scenario: Event manamgement, Linq (to object), ...
If compiler produce a binary and the binary works, that's clearly legal.
But, as you don't put parenthesis on a variable, it's better to use Invoke() to clarify the context.
ashame to forget about '\z' instead of '$'
Speed is not the reason of the necessity to use StringBuilder, it is a consequence.
When you concat 2 string, the system need to create a new array for the new string and copy all the bytes
So, your program will take twice the memory for the operation and copy again and again all the bytes to the new string.
StringBuilder use a bigger array and increased it's size when the limit is reach (like 2,4,8,16,32, ... x2 each times).
Each Append() copy only the bytes of the given string and do array resize time to times when size limit is reached, not each time.
eggplant is useless
As the array is never empty, a cool hack is to initialise 'small' with int.MaxValue
So you don't have to read twice the first value of 'args'. Your solution becomes compliant to more collection's types
This comment is hidden because it contains spoiler information about the solution
If you want more challenge, do it without using loops ;-)
This comment is hidden because it contains spoiler information about the solution
If you truly understand what is behind this code, you never would vote for Best practice nor Clever
A 'foreach' use an iterator and in this case, initialised on the first instance of 's'.
So, if value equal to "4t4" for exemple, the replacement will be executed twice, for each '4' detected.
And nothing will change to the looping context.
A chance that String is immutable in C# and you need to store a new version of it, because modifying a collection during an iteration on it will lead to an exception.
Really good use of Math.Sign() !
And good idea to join both value with negative worth values, that is not a common solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Not enougth 'best practive' for someone who use a StringBuilder for this task.
Side note: string is already seen as a collection of char, ".ToCharArrays()" was not needed
This comment is hidden because it contains spoiler information about the solution
Loading more items...