Collection of Extension methods
Use .net5.0.
Package Manager PM> Install-Package EMDD.Kt.Extensions -Version 1.0.0.1 .NET CLI dotnet add package EMDD.Kt.Extensions --version 1.0.0.1
Collection of methods to deal with 2D array
Loop Through a 2d array
Name | Description |
---|---|
arr | 2D array to work with |
initial | initial Value to work with the aggregate method |
func | function to work for each cycle |
- T - base
- TQ - target
an equivalent array of TQ[,]
All - Extension for 2D array
- T -
Name | Description |
---|---|
array | 2D array of T to work with |
func | Predicate to check |
System.NullReferenceException: Method Cannot be null
Delete the column of an array
Name | Description |
---|---|
arr | 2D Array to work with |
index | index of column to delete |
- T -
Delete multiple col of a 2d Array
- T -
Name | Description |
---|---|
arr | 2D Array to work with |
indices | array of column indices to delete |
Delete the row of 2 dimensional array
Name | Description |
---|---|
arr | 2D Array to work with |
index | index of the row to delete |
- T -
Delete multiple row of a 2d Array
- T -
Name | Description |
---|---|
arr | 2D Array to work with |
indices | row indices to delete |
Loop Through a 2d array without any returns
Name | Description |
---|---|
arr | 2D Array to work with |
action | Action to run for each element |
- T -
Call a Foreach Col method on Matrix
- T -
Name | Description |
---|---|
arr | 2D Array to work with |
rowIndex | zero-based index of row to work with |
action | System.Int32 |
ForEach Col with return type
- Tin -
- Tout -
Name | Description |
---|---|
mat | 2D Array to work with |
rowIndex | zero-based index of row to work with |
func | function to run each element |
System.ArgumentNullException: func can't be null
Call a ForEach Row method on Matrix
- T -
Name | Description |
---|---|
mat | 2D Array |
colIndex | 0:] zero-based index |
action | System.Int32 |
ForEach Row with return type
- Tin -
- Tout -
Name | Description |
---|---|
mat | 2D Array |
colIndex | 0:] zero-based |
func | System.Int32 |
System.ArgumentNullException: func can't be null
Get RowBounds
- T -
Name | Description |
---|---|
mat | 2D Array |
dimension | 0:] |
Check if a 2D array has data
- T -
Name | Description |
---|---|
matrix | 2D Array |
Check if an index is out of bound from an array 2D
- T -
Name | Description |
---|---|
matrix | 2D Array |
index | 0:] |
dimension | System.Int32 |
Loop Through a 2d array
Name | Description |
---|---|
arr | 2D Array |
func | 0:] |
- T -
- TQ -
Loop Through a 2d array
Name | Description |
---|---|
arr | 2D Array |
func | 0:] |
- T -
- TQ -
Get the col
- T -
Name | Description |
---|---|
matrix | 2D Array |
index | 0:] |
Get col and apply some modifications
- Tresult -
- Tbase -
Name | Description |
---|---|
matrix | [0: |
index | 0:] |
func | System.Int32 |
Cast the column of the two dimensional array using a function, func
- TBase -
- TResult -
Name | Description |
---|---|
array | 2D Array |
func | 0:] |
The result is an System.Collections.Generic.IEnumerable`1
Cast the column of the two dimensional array using a function, func
- TBase -
- TInnerResult -
- TResult -
Name | Description |
---|---|
array | 2D Array |
InnerFunc | 0:] |
func | System.Func{``0,} |
The result is an System.Collections.Generic.IEnumerable`1
Get the row
- T -
Name | Description |
---|---|
matrix | 2D Array |
index | 0:] |
Get row and apply some modifications
- Tresult -
- Tbase -
Name | Description |
---|---|
matrix | [0: |
index | 0:] |
func | System.Int32 |
Cast the row of the two dimensional array using a function, func
- TBase -
- TResult -
Name | Description |
---|---|
array | 2D Array |
func | 0:] |
The result is an System.Collections.Generic.IEnumerable`1
modify element in row, modify row and return as an ienumerable
- TBase -
- TInnerResult -
- TResult -
Name | Description |
---|---|
array | 2D Array |
InnerFunc | 0:] |
func | System.Func{``0,} |
Check if Two 2d array are equal
Name | Description |
---|---|
arr1 | 2D Array |
arr2 | 0:] |
- T -
Get the size of a two dimensional array, array, of type T
- T -
Name | Description |
---|---|
array | 2D Array |
System.ValueTuple of (System.Int32 row, System.Int32 col)
swap columns of a 2 dimensional matrix
Name | Description |
---|---|
arr | 2D Array |
index1 | 0:] index of column 1 |
index2 | System.Int64 index of column 2 |
- T -
swap columns of a 2 dimensional matrix
Name | Description |
---|---|
arr | 2D Array |
index1 | 0:] index of column 1 |
index2 | System.Int64 index of column 2 |
- T -
swap rows of a 2 dimensional matrix
Name | Description |
---|---|
arr | 2D Array |
index1 | 0:] index of row 1 |
index2 | System.Int64 index of row 2 |
- T -
swap rows of a 2 dimensional matrix
Name | Description |
---|---|
arr | 2D Array |
index1 | 0:] index of row 1 |
index2 | System.Int64 index of row 2 |
- T -
Convert the array in a tabulated string format
- T -
Name | Description |
---|---|
arr | 2D Array |
Convert Matrix to Dictionary
- T -
Name | Description |
---|---|
matrix | 2D Array |
first row is the ket and the rest are stored on an array
System.IndexOutOfRangeException: Error for less than 2D Array
ToDictionary with same return type
- T1 -
- T2 -
Name | Description |
---|---|
array1 | 2D Array |
array2 | 0:] |
Tranform 2 Column Matrices into Dictionary
- T1 -
- T2 -
Name | Description |
---|---|
array1 | System.Object[0: |
array2 | 0:] |
Extension of type method of ToDictionary
- T1 -
- T2 -
Name | Description |
---|---|
arrays | System.ValueTuple{``0[0:,0:],[0:,0:]} |
extending the static methods of Array abstract class
Add an item to the existing array but creates a new array.
Name | Description |
---|---|
arr | ``0[] |
toAdd | ``0 |
- T -
Deep Clone a array
Name | Description |
---|---|
arrayToClone | ``0[] |
- T -
extending Find method in Array
- T -
Name | Description |
---|---|
array | ``0[] |
match | System.Predicate{``0} |
Array version of List.RemoveAt
Name | Description |
---|---|
arr | ``0[] |
index | System.Int32 |
- T -
System.NullReferenceException: throws exception if array is null
System.Exception: throws exception of array is of zero length
Extensions for BigInteger
Exhaust All Factor of a BigInteger
Name | Description |
---|---|
i | System.Numerics.BigInteger |
Determine if a number is perfect sqaure
Name | Description |
---|---|
A | System.Numerics.BigInteger |
Get the root of a BigInteger
Name | Description |
---|---|
base | System.Numerics.BigInteger |
n | System.Int32 |
System.ArgumentException: root cannot be less than zero
System.ArgumentException: negative value root base 2
Get the Sqrt of BigInteger
Name | Description |
---|---|
number | System.Numerics.BigInteger |
System.ArgumentException: number cannot be less than zero
Extensions for Characters
Comparer for Collection Unarranged
- T -
Equality
Name | Description |
---|---|
x | System.Collections.Generic.IEnumerable{`0} |
y | System.Collections.Generic.IEnumerable{`0} |
Hashcode
Name | Description |
---|---|
obj | System.Collections.Generic.IEnumerable{`0} |
Extensions for dates
Get the end date of the week of a datetime
Name | Description |
---|---|
dt | System.DateTime |
endOfWeek | System.DayOfWeek |
Check if a date is between two spans ( excluding the time)
Name | Description |
---|---|
current | System.DateTime |
start | System.DateTime |
end | System.DateTime |
excludeBounds | System.Boolean |
Check if a date is between two spans ( including thee relevant time)
Name | Description |
---|---|
current | System.DateTime |
start | System.DateTime |
end | System.DateTime |
excludeBounds | System.Boolean |
Return the total months of a datetime
Name | Description |
---|---|
date | System.DateTime |
Get the start date of the week a datetime
Name | Description |
---|---|
dt | System.DateTime |
startOfWeek | System.DayOfWeek |
Get Total Weeks of a datetime
Name | Description |
---|---|
date | System.DateTime |
Extensions for Diagnostics
Get Elapsed time for action
Name | Description |
---|---|
action | System.Action |
Compare double data type
Determines whether the specified objects are equal.
true if the specified objects are equal; otherwise, false.
Name | Description |
---|---|
x | System.Double The first object of type to compare. |
y | System.Double The second object of type to compare. |
Returns a hash code for the specified object.
A hash code for the specified object.
Name | Description |
---|---|
obj | System.Double The System.Object for which a hash code is to be returned. |
System.ArgumentNullException: The type of obj is a reference type and obj is null.
Extensions for Ienumerable
Partition collection and aggregate Results stored in a dictionary
- TBase -
- TKey -
- TValue -
Name | Description |
---|---|
collection | System.Collections.Generic.IEnumerable{``0} |
getKey | System.Func{``0,} |
getValue | System.Func{``0,``2} |
func | System.Func{``2,``2,``2} |
Partition collection and aggregate Results stored in a dictionary
- TBase -
- TKey -
- TComparer -
- TValue -
Name | Description |
---|---|
collection | System.Collections.Generic.IEnumerable{``0} |
getKey | System.Func{``0,} |
comparer | ``2 |
getValue | System.Func{``0,``3} |
func | System.Func{``3,``3,``3} |
Partition collection and aggregate Results
- TBase -
- TKey -
- TValue -
- TResult -
Name | Description |
---|---|
collection | System.Collections.Generic.IEnumerable{``0} |
getKey | System.Func{``0,} |
getValue | System.Func{``0,``2} |
func | System.Func{``2,``2,``2} |
getOutput | System.Func{,``2,``3} |
Partition collection and aggregate Results
- TBase -
- TKey -
- TComparer -
- TValue -
- TResult -
Name | Description |
---|---|
collection | System.Collections.Generic.IEnumerable{``0} |
getKey | System.Func{``0,} |
comparer | ``2 |
getValue | System.Func{``0,``3} |
func | System.Func{``3,``3,``3} |
getOutput | System.Func{,``3,``4} |
Combined Aggregate and Select
- TBase -
- TResult -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
seed | |
func | System.Func{,``0,} |
Similar to Ienumerable.Any() but excludes checking a certain element
- T -
Name | Description |
---|---|
source | System.Collections.Generic.IEnumerable{``0} |
except | ``0 Excluded Element |
func | System.Func{``0,System.Boolean} |
Extended Concat Method where the enumerable to be concatenated is params
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
toConCat | System.Collections.Generic.IEnumerable{``0}[] |
Determine if two collections have the same content
- T -
Name | Description |
---|---|
a | System.Collections.Generic.IEnumerable{``0} |
b | System.Collections.Generic.IEnumerable{``0} |
Select + Select Many/ Nested Linq from - operator for two collections
- T1 -
- T2 -
- TResult -
Name | Description |
---|---|
col1 | System.Collections.Generic.IEnumerable{``0} |
col2 | System.Collections.Generic.IEnumerable{} |
func | System.Func{``0,,``2} |
Use the whole word as suggestion
Name | Description |
---|---|
items | System.Collections.IEnumerable |
keyword | System.String |
propertyName | System.String |
Search filter ienumerable
Name | Description |
---|---|
items | System.Collections.IEnumerable |
keyword | System.String |
propertyName | System.String |
Get the first item on both enumerable that satifies the boolean function
- Tfirst -
- Tsecond -
Name | Description |
---|---|
pair | System.ValueTuple{System.Collections.Generic.IEnumerable{``0} |
func | System.Collections.Generic.IEnumerable{}} |
Two way fork by using Ternary conditions
- T -
Name | Description |
---|---|
source | System.Collections.Generic.IEnumerable{``0} |
pred | System.Func{``0,KtExtensions.EnumerableExtensions.Ternary} |
Splits an ienumerable in two based on the boolean condition stated,
Reference:
Byers, M (2010,December 28) C#: Can I split an IEnumerable into two by a boolean criteria without two queries? [Online forum comment].Message to posted to https://stackoverflow.com/questions/4549339/can-i-split-an-ienumerable-into-two-by-a-boolean-criteria-without-two-queries
- T - Type
Name | Description |
---|---|
source | System.Collections.Generic.IEnumerable{``0} the Ienumerable to be split |
pred | System.Func{``0,System.Boolean} boolean condition |
value tuple 2 two groups
Works like LInq Contains
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
itemToFind | ``0 |
Get the Underlaying type of items inside an Ilist
Name | Description |
---|---|
myList | System.Collections.IList |
Check if a collection contains any data
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
boxing of any enumerable to it's interface equivalence
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
Get the minimum and maximum value of enumerable based on IsLesser and IsGreater
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
IsLesser | System.Func{``0,``0,System.Boolean} Check if a value is lesser that another |
IsGreater | System.Func{``0,``0,System.Boolean} Check if a value is greater that another |
Determine where the min and max value of T resulting to double, from an ienumerable enumerable
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
func | System.Func{``0,System.Double} function to convert the item T to a System.Double |
Determine where the min and max value of T resulting to double, from an ienumerable enumerable
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
func | System.Func{``0,System.Int32} function to convert the item T to a System.Int32 |
Ienumerable.OfType but takes two type signature
- T1 -
- T2 -
Name | Description |
---|---|
main | System.Collections.IEnumerable |
Ienumerable.OfType but takes three type signature
- T1 -
- T2 -
- T3 -
Name | Description |
---|---|
main | System.Collections.IEnumerable |
Ienumerable.OfType but takes four type signature
- T1 -
- T2 -
- T3 -
- T4 -
Name | Description |
---|---|
main | System.Collections.IEnumerable |
Ienumerable.OfType but takes five type signature
- T1 -
- T2 -
- T3 -
- T4 -
- T5 -
Name | Description |
---|---|
main | System.Collections.IEnumerable |
Ienumerable.OfType but takes six type signature
- T1 -
- T2 -
- T3 -
- T4 -
- T5 -
- T6 -
Name | Description |
---|---|
main | System.Collections.IEnumerable |
Ienumerable.OfType but takes 7 type signature
- T1 -
- T2 -
- T3 -
- T4 -
- T5 -
- T6 -
- T7 -
Name | Description |
---|---|
main | System.Collections.IEnumerable |
Ienumerable.OfType but takes 8 type signature
- T1 -
- T2 -
- T3 -
- T4 -
- T5 -
- T6 -
- T7 -
- T8 -
Name | Description |
---|---|
main | System.Collections.IEnumerable |
Partition
- T1 -
- T2 -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{} |
func | System.Func{,``0} |
Reverse Select an Array
- TBase -
- TResult -
Name | Description |
---|---|
source | ``0[] |
conversion | System.Func{``0,} |
break | System.Func{``0,System.Boolean} |
continue | System.Func{``0,System.Boolean} |
Reverse Select an Array
- TBase -
- TResult -
Name | Description |
---|---|
source | ``0[] |
conversion | System.Func{``0,} |
Return an ienumerable of a tuple paired for a successive items
- T -
Name | Description |
---|---|
inum | System.Collections.Generic.IEnumerable{``0} |
IEnumerable Select But using successive pairs
Name | Description |
---|---|
inum | System.Collections.Generic.IEnumerable{``0} |
method | System.Func{``0,``0,} |
- T -
- TD -
System.NullReferenceException: method cannot be null
Find First and split it from the main enumerable
- T -
Name | Description |
---|---|
source | System.Collections.Generic.IEnumerable{``0} |
predicate | System.Func{``0,System.Boolean} |
Divide an ienumerable into two; first value's size is based on Count.
- T -
Name | Description |
---|---|
source | System.Collections.Generic.IEnumerable{``0} |
count | System.Int32 |
3 boolean type
false
nuetral
true
Venn Group Elements of two enumerables based on venn diagram rep
- T -
Name | Description |
---|---|
AA | System.Collections.Generic.IEnumerable{``0} |
BB | System.Collections.Generic.IEnumerable{``0} |
Exclusion Inclusion of Elements of two collections
- T -
Name | Description |
---|---|
ienums | System.ValueTuple{System.Collections.Generic.IEnumerable{``0} |
comparer | System.Collections.Generic.IEnumerable{``0}} |
Exclude other from the query
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
other | ``0 |
Exclude others from the query
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
others | System.Collections.Generic.IEnumerable{``0} |
same Linq -Where but the predicate is negated
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
predicate | System.Predicate{``0} |
Collection of methods for equality purposes
Chain the hashcode of the new item to the previous
- T -
Name | Description |
---|---|
hash | System.Int32 initial hash |
other | ``0 other item |
multiplier | System.Int32 |
Chain the hashcode of the new item to the previous
- T -
Name | Description |
---|---|
hash | System.Int32 initial hash |
other | ``0 other item |
Chain the hashcode of the new item to the previous
- T -
Name | Description |
---|---|
hash | System.Int32 initial hash |
other | ``0[] other item |
Chain the hashcode of the new item to the previous
- T -
Name | Description |
---|---|
hash | System.Int32 initial hash |
other | System.Collections.Generic.IEnumerable{``0} other item |
Shortened System.Collections.Generic.EqualityComparer`1.Default.Equals
- T -
Name | Description |
---|---|
a | ``0 |
b | ``0 |
Test if an element of type T is equal to an object
- T -
Name | Description |
---|---|
a | ``0 |
obj | System.Object |
final | System.Func{``0,System.Boolean} |
Determine the hashcode of an array using EqualityExtensions.ChainHashCode(System.Int32,``0) method
- T -
Name | Description |
---|---|
array | ``0[] |
Determine the hashcode of an enumerable using EqualityExtensions.ChainHashCode(System.Int32,``0) method
- T -
Name | Description |
---|---|
array | System.Collections.Generic.IEnumerable{``0} |
Test for null before doing the final equality check of final
- T -
Name | Description |
---|---|
a | ``0 |
b | ``0 |
final | System.Boolean |
Test for null before doing the final equality check of final
- T -
Name | Description |
---|---|
a | ``0 |
b | ``0 |
final | System.Func{``0,System.Boolean} |
Test for null before doing the final equality check of final
- T -
Name | Description |
---|---|
a | ``0 |
b | ``0 |
final | System.Func{System.Boolean} |
Extensions for System.IO.File and System.IO.Path
Check if a file can be opened
Name | Description |
---|---|
filePath | System.String |
extension of File.Copy where destination name will be made unique using FilePathExtensions.GetUniqueFilePath(System.String)
Name | Description |
---|---|
source | System.String |
filePathDestination | System.String |
Make file path unique
Name | Description |
---|---|
filepath | System.String |
Extensions for generic types
Check if a generic value of type T is null Reference: McGivern, D. (2011,Febuary 10) C#: Alternative to GenericType == null [Online forum comment].Message to posted to https://stackoverflow.com/questions/565564/c-alternative-to-generictype-null modification was done by using IsNullable() Method
- T -
Name | Description |
---|---|
value | ``0 |
Create an Array using the value with "times" size
Name | Description |
---|---|
val | ``0 |
times | System.Int32 size of the array |
- T -
Create a List using the value with "times" size
Name | Description |
---|---|
val | ``0 |
times | System.Int32 size of the list |
- T -
List Extensions
Deep Clone a List
Name | Description |
---|---|
listToClone | System.Collections.Generic.List{``0} |
- T -
Determine the first pair in list that passed the test
Name | Description |
---|---|
listToLoop | System.Collections.Generic.List{``0} |
test | System.Func{``0,``0,System.Boolean} |
- T -
if fails it returns null
Find the Element and return its index
- T -
Name | Description |
---|---|
list | System.Collections.Generic.List{``0} |
item | ``0 |
comparer | System.Collections.Generic.IEqualityComparer{``0} |
Find the Element and return its index using the Default Equality Comparer
- T -
Name | Description |
---|---|
list | System.Collections.Generic.List{``0} |
item | ``0 |
Run for loop using action which takes in System.Int32 index and the item of T
- T -
Name | Description |
---|---|
list | System.Collections.Generic.List{``0} |
action | System.Action{``0,System.Int32} is null, the method will not run |
Loop through a List using the two consecutive elements
Name | Description |
---|---|
System.Collections.Generic.List{``0} |
|
listToLoop | System.Action{``0,``0} The list for looping, count must be beyond 2 |
action | Unknown type |
- T -
swap elements of a List
Name | Description |
---|---|
list | System.Collections.Generic.List{``0} |
index1 | System.Int32 index of row 1 |
index2 | System.Int32 index of row 2 |
- T -
Improved Action methods
Runs based on a the condition of condition, runs ifTrue if condition is true and runs ifFalse if condition is false
Name | Description |
---|---|
condition | System.Boolean |
ifTrue | System.Action |
ifFalse | System.Action |
Inception type of function. create a value null, assign a value
- T -
Name | Description |
---|---|
func | System.Func{System.Func{``0},``0} |
Chainable initial values to func
- Tseed -
- Tresult -
Name | Description |
---|---|
seed | System.Func{``0} |
result | System.Func{``0,} |
Chainable initial values to func
- Tseed1 -
- Tseed2 -
- Tresult -
Name | Description |
---|---|
seed1 | System.Func{``0} |
seed2 | System.Func{} |
result | System.Func{``0,,``2} |
Chainable initial values to func
- Tseed1 -
- Tseed2 -
- Tresult -
Name | Description |
---|---|
seed | System.Func{System.ValueTuple{``0,}} |
result | System.Func{``0,,``2} |
Chainable initial values to func
- Tseed1 -
- Tseed2 -
- Tseed3 -
- Tresult -
Name | Description |
---|---|
seed1 | System.Func{``0} |
seed2 | System.Func{} |
seed3 | System.Func{``2} |
result | System.Func{``0,,``2,``3} |
Chainable initial values to func: Tuple of 3
- Tseed1 -
- Tseed2 -
- Tseed3 -
- Tresult -
Name | Description |
---|---|
seed | System.Func{System.ValueTuple{``0,,``2}} |
result | System.Func{``0,,``2,``3} |
Chainable initial values to func
- Tseed1 -
- Tseed2 -
- Tseed3 -
- Tseed4 -
- Tresult -
Name | Description |
---|---|
seed1 | System.Func{``0} |
seed2 | System.Func{} |
seed3 | System.Func{``2} |
seed4 | System.Func{``3} |
result | System.Func{``0,,``2,``3,``4} |
Chainable initial values to func: Tuple of 4
- Tseed1 -
- Tseed2 -
- Tseed3 -
- Tseed4 -
- Tresult -
Name | Description |
---|---|
seed | System.Func{System.ValueTuple{``0,,``2,``3}} |
result | System.Func{``0,,``2,``3,``4} |
Chainable initial values to func
- Tseed1 -
- Tseed2 -
- Tseed3 -
- Tseed4 -
- Tresult -
Name | Description |
---|---|
seed1 | System.Func{System.ValueTuple{``0,}} |
seed2 | System.Func{System.ValueTuple{``2,``3}} |
result | System.Func{``0,,``2,``3,``4} |
Chainable initial values to func: 5 seed elements
- Tseed1 -
- Tseed2 -
- Tseed3 -
- Tseed4 -
- Tseed5 -
- Tresult -
Name | Description |
---|---|
seed1 | System.Func{``0} |
seed2 | System.Func{} |
seed3 | System.Func{``2} |
seed4 | System.Func{``3} |
seed5 | System.Func{``4} |
result | System.Func{``0,,``2,``3,``4,``5} |
Chainable initial values to func: Tuple of 5
- Tseed1 -
- Tseed2 -
- Tseed3 -
- Tseed4 -
- Tseed5 -
- Tresult -
Name | Description |
---|---|
seed | System.Func{System.ValueTuple{``0,,``2,``3,``4}} |
result | System.Func{``0,,``2,``3,``4,``5} |
Extensions for converting numeric values to proper string format
Convert a number into string exponential form string
Name | Description |
---|---|
val | System.Double |
Numeric Extensions
Return the angle in degrees
Name | Description |
---|---|
y | System.Double numerator of the tangent function |
x | System.Double denominator of the tangent function |
get the decimal place of first significant figure
Name | Description |
---|---|
val | System.Double |
(v1,v2) => v1.CompareTo(v2)
Name | Description |
---|---|
values | System.ValueTuple{System.Double,System.Double} |
Used for looping through circular sequence
Name | Description |
---|---|
val1 | System.Double The Number that loops |
val2 | System.Double The Begining of the loop |
val3 | System.Double The end of the loop |
Looped equivalent of val1
Used for looping through circular sequence
Name | Description |
---|---|
val1 | System.Int32 The Number that loops |
val2 | System.Int32 The Begining of the loop |
val3 | System.Int32 The end of the loop |
Looped equivalent of val1
multiply a number with 10 raised to ____
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Double Power of th multiplyier number "10" |
multiply a number with 10 raised to ____
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Int32 Power of th multiplyier number "10" |
Check if a string can potentially be converted into number
Name | Description |
---|---|
val | System.String |
Return if a double value has floating values
Name | Description |
---|---|
val | System.Double |
Check if string is a number and has float values.
Name | Description |
---|---|
val | System.String string to check |
Convert an integer to an array of single digits
Name | Description |
---|---|
val | System.Int64 |
check if a number is infinity or NaN
Name | Description |
---|---|
val | System.Double the value to be tested |
Boolean value
Test if a number is inside but should not be on the limits
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Double Limit 1 |
val3 | System.Double Limit 2 |
Test if a number is inside but should not be on the limits
Name | Description |
---|---|
val1 | System.Int32 |
val2 | System.Int32 Limit 1 |
val3 | System.Int32 Limit 2 |
Test if a number is inside but should not be on the limits
Name | Description |
---|---|
val1 | System.Int64 |
val2 | System.Int64 Limit 1 |
val3 | System.Int64 Limit 2 |
Determine if an integer is Even
Name | Description |
---|---|
value | System.Int32 |
Determine if a string can be converted into a number, Similar VB.net IsNumeric Function
Name | Description |
---|---|
val | System.String The string to be tested |
Boolean Value
Test if a number is inside or exactly on the limits
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Double Limit 1 |
val3 | System.Double Limit 2 |
Test if a number is inside or exactly on the limits
Name | Description |
---|---|
val1 | System.Double |
limits | System.ValueTuple{System.Double,System.Double} |
Test if a number is inside or exactly on the limits
Name | Description |
---|---|
val1 | System.Int32 |
val2 | System.Int32 Limit 1 |
val3 | System.Int32 Limit 2 |
Test if a number is inside or exactly on the limits
Name | Description |
---|---|
val1 | System.Int32 |
limits | System.ValueTuple{System.Int32,System.Int32} |
Make a value stay within the limits (Including the limits themselves)
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Double Limit 1 |
val3 | System.Double Limit |
Make a value stay within the limits (Including the limits themselves)
Name | Description |
---|---|
val1 | System.Int32 |
val2 | System.Int32 Limit 1 |
val3 | System.Int32 Limit |
Make a value stay within the limits (Including the limits themselves)
Name | Description |
---|---|
val1 | System.Int64 |
val2 | System.Int64 Limit 1 |
val3 | System.Int64 Limit |
determine the min or max of two doubles
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Double |
determine the min or max of two integers
Name | Description |
---|---|
val1 | System.Int32 |
val2 | System.Int32 |
Check if a number is Approximately Equal to the other
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Double |
accuracy | System.Int32 |
Determine if a double number is almost equal to zero
Name | Description |
---|---|
val | System.Double |
accuracy | System.Int32 accuracy to the n'th degree |
Check if a double value is an integer
Name | Description |
---|---|
val | System.Double |
precision | System.Int32 |
Numeric Enumeration
Less that 0
Exactly Zero
Greater than 0
Acts like an exponent/power
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Double exponent |
Acts like an exponent/power
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Int32 exponent |
Acts like an exponent/power
Name | Description |
---|---|
val1 | System.Int32 |
val2 | System.Double exponent |
Acts like an exponent/power
Name | Description |
---|---|
val1 | System.Int32 |
val2 | System.Int32 exponent |
Round for every interval
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Double interval |
Round for every interval
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Int32 interval |
Round down for every interval
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Double interval |
Round down for every interval
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Int32 interval |
Roundup for every interval
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Double interval |
Roundup for every interval
Name | Description |
---|---|
val1 | System.Double |
val2 | System.Int32 interval |
Return the scientific notation
Name | Description |
---|---|
val | System.Double todo: describe val parameter on ScientificNotation |
return a tuple of significant figure in 1's and the base 10 exponent
Determine the sign of a number
Name | Description |
---|---|
num | System.Double |
accuracy | System.Int32 |
Determine the sign of a number
Name | Description |
---|---|
num | System.Int32 |
Round the value based on the repeated 999's and 000's
Name | Description |
---|---|
val | System.Double |
digits | System.Int64[] |
Round The number by finding the first repeated digits from the number;
Name | Description |
---|---|
val | System.Double |
digits | System.Int64[] digits that are repeated |
Desirable tostring of a double data type
Name | Description |
---|---|
val | System.Double |
Make 15 decimals to array
Name | Description |
---|---|
val | System.Double |
Convert a string to a number, if the string is not numeric then the return value will be zero
Name | Description |
---|---|
val | System.String |
Grouping of Ienumerable
- TKey -
- TValue -
base Constructor
Constructor
Name | Description |
---|---|
info | System.Runtime.Serialization.SerializationInfo |
context | System.Runtime.Serialization.StreamingContext |
Add Individual Element
Name | Description |
---|---|
key | `0 |
value | `1 |
Add a partition
Name | Description |
---|---|
key | `0 |
value | System.Collections.Generic.List{`1} |
Create Partition
Name | Description |
---|---|
key | `0 |
Remove a partition
Name | Description |
---|---|
key | `0 |
Reflection extensions
Get the property value cascaded to its subproperties
Name | Description |
---|---|
o | System.Object |
name | System.String |
Get the property value cascaded to its subproperties
Name | Description |
---|---|
o | System.Object |
pNames | System.String[] |
The the value of the runtime property of name pName
Name | Description |
---|---|
o | System.Object |
pName | System.String |
System.ArgumentNullException:
Get the value of Property and cast it to it's proper type
- T -
Name | Description |
---|---|
obj | System.Object |
propertyName | System.String |
Search all property names, get their values, and store them into a dictionary of string/object generic type
Name | Description |
---|---|
obj | System.Object |
Search all property names, get their values, and store them into a dictionary of string/object generic type
Name | Description |
---|---|
objs | System.Collections.Generic.IEnumerable{``0} |
Get value of object
Name | Description |
---|---|
o | System.Object |
pName | System.String |
String extensions
Append new line to the string builder
Name | Description |
---|---|
sb | System.Text.StringBuilder |
Append A string then add new line
Name | Description |
---|---|
sb | System.Text.StringBuilder |
str | System.String |
Append A string then when
Name | Description |
---|---|
sb | System.Text.StringBuilder |
str | System.String |
predicate | System.Func{System.Boolean} |
Concatenate all the element System.Object.ToString value of an enumerable
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
separator | System.String String separating each string |
enclosure | System.ValueTuple{System.String,System.String} strings enclosing the element string |
Concatenate all the element System.Object.ToString value of an enumerable
- T -
Name | Description |
---|---|
enumerable | System.Collections.Generic.IEnumerable{``0} |
separator | System.String String separating each string |
Make First Letter of a string into lower character
Name | Description |
---|---|
str | System.String |
Make First Letter of a string into upper character
Name | Description |
---|---|
str | System.String |
Guard Claused Equals w/ string comparison
Name | Description |
---|---|
str1 | System.String |
str2 | System.String |
stringComparison | System.StringComparison |
Guard Claused Equals
Name | Description |
---|---|
str1 | System.String |
str2 | System.String |
Determine if a character is inside a list of characters
Name | Description |
---|---|
this | System.String |
possibles | System.Char[] |
Determine if a character is inside a list of strings
Name | Description |
---|---|
this | System.String |
possibles | System.String[] |
Similar to System.String.IsNullOrEmpty(System.String)
Name | Description |
---|---|
str | System.String |
Check if string is a duplicate and create new numbered string
Name | Description |
---|---|
str | System.String |
strs | System.Collections.Generic.IEnumerable{System.String} |
maxLength | System.Int32 |
Check if string is a duplicate and create new numbered string
Name | Description |
---|---|
str | System.String |
strs | System.Collections.Generic.IEnumerable{System.String} |
Remove the last letter of the string
Name | Description |
---|---|
str | System.String |
Remove Vowels from strings
Name | Description |
---|---|
str | System.String |
Concatenate a repeat string at a number of times
Name | Description |
---|---|
str | System.String the string to be repeated |
count | System.Int32 number of times to repeat |
Be able identify if it is good to append a text to the main text
if str is null or empty then an empty text is returned
Name | Description |
---|---|
str | System.String |
strToAppend | System.String |
Concat Two strings with a filler
Name | Description |
---|---|
str1 | System.String |
str2 | System.String |
filler | System.String |
Concat strings with filler
Name | Description |
---|---|
str | System.String |
toConcat | System.String[] |
filler | System.String |
Be able identify if it is good to prepend a text to the main text
if str is null or empty then an empty text is returned
Name | Description |
---|---|
str | System.String |
strToPrepend | System.String |
Separate String and Number, example "text (1)" the text and the number will be extracted
Name | Description |
---|---|
text | System.String |
text and a number, "text (1)" return "text " and "1"
Convert integers to words
Name | Description |
---|---|
number | System.Int32 |
Extensions for type
Get all type derivation Reference: KallDrexx (2011, June 21). How can I use reflection to return all classes subclassing from a generic, without giving a specific generic type [Online forum comment]. Message posted to https://stackoverflow.com/questions/6426949/how-can-i-use-reflection-to-return-all-classes-subclassing-from-a-generic-witho/6427201#6427201
Name | Description |
---|---|
type | System.Type |
Determine if a type is derived from open generic type Reference: KallDrexx (2011, June 21). How can I use reflection to return all classes subclassing from a generic, without giving a specific generic type [Online forum comment]. Message posted to https://stackoverflow.com/questions/6426949/how-can-i-use-reflection-to-return-all-classes-subclassing-from-a-generic-witho/6427201#6427201
Name | Description |
---|---|
type | System.Type |
openGenericType | System.Type |
System.ArgumentNullException:
System.ArgumentException:
Determine if a generic param is a Nullable type Reference: Traub, D. (2011, March 3). Determine if a generic param is a Nullable type [Online forum comment]. Message posted to https://stackoverflow.com/questions/5181494/determine-if-a-generic-param-is-a-nullable-type
Name | Description |
---|---|
type | System.Type |