string literals are defined by wrapping the value with double-quotes ":
string s = "hello, this is a string literal";
String literals may contain escape sequences. See String Escape Sequences
Additionally, C# supports verbatim string literals (See Verbatim Strings). These are def...
char literals are defined by wrapping the value with single-quotes ':
char c = 'h';
Character literals may contain escape sequences. See String Escape Sequences
A character literal must be exactly one character long (after all escape sequences have been evaluated). Empty character literals are ...
ulong literals are defined by using the suffix UL, ul, Ul, uL, LU, lu, Lu, or lU, or by using an integral values within the range of ulong:
ulong ul = 5UL;
Extension methods enable you to simplify your interface definitions by only including core required functionality in the interface itself and allowing you to define convenience methods and overloads as extension methods. Interfaces with fewer methods are easier to implement in new classes. Keeping o...
String literals represent null-terminated, static-duration arrays of char. Because they have static storage duration, a string literal or a pointer to the same underlying array can safely be used in several ways that a pointer to an automatic array cannot. For example, returning a string literal f...
If you need to know whether a value's type extends or implements a given type, but you don't want to actually cast it as that type, you can use the is operator.
if(value is int)
{
Console.WriteLine(value + "is an int");
}
Enums can be mutable, this is another way to obtain a singleton behavior:
enum class Planet(var population: Int = 0) {
EARTH(7 * 100000000),
MARS();
override fun toString() = "$name[population=$population]"
}
println(Planet.MARS) // MARS[population=0]
Planet.MARS.p...
DBContract.java
//Define the tables and columns of your local database
public final class DBContract {
/*Content Authority its a name for the content provider, is convenient to use the package app name to be unique on the device */
public static final String CONTENT_AUTHORITY =...
The split-sequence library provides a function split-sequence, which allows to split on elements of a sequence
(split-sequence:split-sequence #\Space "John Doe II")
;; => ("John" "Doe" "II")