\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Sara (lasago)} \pdfinfo{ /Title (c.pdf) /Creator (Cheatography) /Author (Sara (lasago)) /Subject (C\# Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{C\# Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Sara (lasago)} via \textcolor{DarkBackground}{\uline{cheatography.com/70899/cs/20398/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Sara (lasago) \\ \uline{cheatography.com/lasago} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 25th October, 2019.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{tabularx}{17.67cm}{x{5.3537 cm} x{11.9163 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Create, run, debug programs from scratch}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{View\textgreater{}Terminal} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} dotnet new console & Creates new Hello World program from scratch \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} dotnet restore & resolve .NET build assets \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} dotnet run & Run the program \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Debugging} \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{Debug\textgreater{} .NET Core Launch (Console)} \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Click line, add red dot (breakpoint), F5(run), local variables on left} \tn % Row Count 10 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{Compiling} \tn % Row Count 11 (+ 1) % Row 8 \SetRowColor{LightBackground} & csc hello.cs \tn % Row Count 12 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{7.9442 cm} x{9.3258 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{New Class}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{File MyClass.cs} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Inside: & using System;\{\{nl\}\}namespace SameAsMains\{\{\{nl\}\}classMyClass\{\{\{nl\}\}//...\} \tn % Row Count 5 (+ 4) % Row 2 \SetRowColor{LightBackground} Reference MyClass in another class & MyClass c1 = new MyClass(); \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} & c1.function(); \tn % Row Count 8 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} p{1.727 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{C\#}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{C\# is an object-oriented language, but C\# further includes support for component-oriented programming.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{All C\# types, including primitive types such as int and double, inherit from a single root object type.} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{C\# supports both user-defined reference types and value types} \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{The "Hello, World" program starts with a using directive that references the System namespace.} \tn % Row Count 10 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Namespaces provide a hierarchical means of organizing C\# programs and libraries. Namespaces contain types and other namespaces—for example, the System namespace contains a number of types, such as the Console class referenced in the program, and a number of other namespaces, such as IO and Collections.} \tn % Row Count 17 (+ 7) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{A using directive that references a given namespace enables unqualified use of the types that are members of that namespace. Because of the using directive, the program can use Console.WriteLine as shorthand for \seqsplit{System.Console.WriteLine.}} \tn % Row Count 22 (+ 5) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{While instance methods can reference a particular enclosing object instance using the keyword this, static methods operate without reference to a particular object.} \tn % Row Count 26 (+ 4) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{short x = 2, y = 3 will make x a short and y an int} \tn % Row Count 28 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.181 cm} x{12.089 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Types}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{string} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{Length (str.Length)} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Enum & The enum keyword is used to declare an enumeration, a distinct type that consists of a set of named constants called the enumerator list. \tn % Row Count 7 (+ 5) % Row 3 \SetRowColor{white} & By default, the first enumerator has the value 0, and the value of each successive enumerator is increased by 1. For example, in the following enumeration, Sat is 0, Sun is 1, Mon is 2, and so forth. \tn % Row Count 15 (+ 8) % Row 4 \SetRowColor{LightBackground} & enum Day \{Sat, Sun, Mon, Tue, Wed, Thu, Fri\}; \tn % Row Count 17 (+ 2) % Row 5 \SetRowColor{white} & Enumerators can use initializers to override the default values, as shown in the following example. \tn % Row Count 21 (+ 4) % Row 6 \SetRowColor{LightBackground} & enum Day \{Sat=1, Sun, Mon, Tue, Wed, Thu, Fri\}; \tn % Row Count 23 (+ 2) % Row 7 \SetRowColor{white} & Every enumeration type has an underlying type, which can be any integral numeric type. The char type cannot be an underlying type of an enum. The default underlying type of enumeration elements is int. To declare an enum of another integral type, such as byte, use a colon after the identifier followed by the type, as shown in the following example. \tn % Row Count 36 (+ 13) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.181 cm} x{12.089 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Types (cont)}} \tn % Row 8 \SetRowColor{LightBackground} & enum Day : byte \{Sat=1, Sun, Mon, Tue, Wed, Thu, Fri\}; \tn % Row Count 2 (+ 2) % Row 9 \SetRowColor{white} & an explicit cast is necessary to convert from enum type to an integral type. \tn % Row Count 5 (+ 3) % Row 10 \SetRowColor{LightBackground} & int x = (int)Day.Sun; \tn % Row Count 6 (+ 1) % Row 11 \SetRowColor{white} Enteros con signo & sbyte, short, int, long \tn % Row Count 8 (+ 2) % Row 12 \SetRowColor{LightBackground} Enteros sin signo & byte, ushort, ulong, uint \tn % Row Count 10 (+ 2) % Row 13 \SetRowColor{white} FLoating point & float, double \tn % Row Count 12 (+ 2) % Row 14 \SetRowColor{LightBackground} float and double & binary point, not 100\% accurate \tn % Row Count 14 (+ 2) % Row 15 \SetRowColor{white} decimal & decimal, as accurate as you can get \tn % Row Count 16 (+ 2) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Value types} \tn % Row Count 17 (+ 1) % Row 17 \SetRowColor{white} Simple & todos los anteriores y bool \tn % Row Count 18 (+ 1) % Row 18 \SetRowColor{LightBackground} \seqsplit{Enumeración} & enum e \{\} \tn % Row Count 19 (+ 1) % Row 19 \SetRowColor{white} Estructura & struct S \{\} \tn % Row Count 20 (+ 1) % Row 20 \SetRowColor{LightBackground} & \seqsplit{https://samrueby.com/2016/09/05/when-should-you-use-a-struct-instead-of-a-class/} \tn % Row Count 23 (+ 3) % Row 21 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{Reference types} \tn % Row Count 24 (+ 1) % Row 22 \SetRowColor{LightBackground} Class types & object, string, class C\{\} \tn % Row Count 25 (+ 1) % Row 23 \SetRowColor{white} Interface types & interface I \{\} \tn % Row Count 27 (+ 2) % Row 24 \SetRowColor{LightBackground} Tipos de matroz & int{[}{]}¸int{[},{]} \tn % Row Count 29 (+ 2) % Row 25 \SetRowColor{white} Delegate types & delegate int D\{\} \tn % Row Count 31 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.3537 cm} x{11.9163 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Input and Output}} \tn % Row 0 \SetRowColor{LightBackground} Print line & \seqsplit{System.Console.WriteLine()} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} & System.Console.Write() \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Format string (\$) & \seqsplit{Console.WriteLine(\$"Hello} World! \{c1.returnMessage()\}"); \tn % Row Count 5 (+ 3) % Row 3 \SetRowColor{white} Read line (string) & Console.ReadLine(); \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} Read char & \seqsplit{Console.ReadKey().KeyChar;} \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} Read Int & int n = \seqsplit{int.Parse(Console.ReadLine());} \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Read float} \tn % Row Count 11 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{\seqsplit{https://docs.microsoft.com/es-es/dotnet/csharp/language-reference/tokens/interpolated}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Data Structures and Collections}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{{\emph{Array}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} create and initialize & String{[}{]} Words = new String{[}10{]}; \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} create, initialize and fill & int{[}{]} prueba = new int{[}20{]}\{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20\}; \tn % Row Count 7 (+ 4) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{int{[}{]} vector = \{1,2,4\}} \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{access values} \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{save values} \tn % Row Count 10 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{array (multidimensional)} \tn % Row Count 11 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{create and initialize} \tn % Row Count 12 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{create, initialize and fill} \tn % Row Count 13 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{access values} \tn % Row Count 14 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{save values} \tn % Row Count 15 (+ 1) % Row 11 \SetRowColor{white} get size & .Length \tn % Row Count 16 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{List} \tn % Row Count 17 (+ 1) % Row 13 \SetRowColor{white} create and initialize & var names = new List\textless{}string\textgreater{} \{ "\textless{}name\textgreater{}", "Ana", "Felipe" \}; \tn % Row Count 20 (+ 3) % Row 14 \SetRowColor{LightBackground} add to the end of the list & names.Add("Maria"); \tn % Row Count 22 (+ 2) % Row 15 \SetRowColor{white} remove from the end & \seqsplit{names.Remove("Ana");} \tn % Row Count 23 (+ 1) % Row 16 \SetRowColor{LightBackground} access & \seqsplit{Console.WriteLine(\$"My} name is \{names{[}0{]}\}."); \tn % Row Count 26 (+ 3) % Row 17 \SetRowColor{white} length & \seqsplit{Console.WriteLine(\$"The} list has \{names.Count\} people in it"); \tn % Row Count 30 (+ 4) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Data Structures and Collections (cont)}} \tn % Row 18 \SetRowColor{LightBackground} indexOf & var index = \seqsplit{names.IndexOf("Felipe");} \tn % Row Count 2 (+ 2) % Row 19 \SetRowColor{white} Sort & names.Sort(); \tn % Row Count 3 (+ 1) % Row 20 \SetRowColor{LightBackground} Add new values from array to list & n3.AddRange(n1); \tn % Row Count 5 (+ 2) % Row 21 \SetRowColor{white} {\bf{Dictionary\textless{}TKey,TValue\textgreater{}}} & Tkey : The type of the keys in the dictionary. \{\{nl\}\}The type of the values in the dictionary. \tn % Row Count 10 (+ 5) % Row 22 \SetRowColor{LightBackground} Declare Dictionary with String key and value & Dictionary\textless{}string, string\textgreater{} openWith = new Dictionary\textless{}string, string\textgreater{}(); \tn % Row Count 14 (+ 4) % Row 23 \SetRowColor{white} Declare and initialize DIctionary & var myDict = new Dictionary\textless{}string, string\textgreater{} \{ \{ "key1", "value1" \}, \{ "key2", "value2" \} \}; \tn % Row Count 21 (+ 7) % Row 24 \SetRowColor{LightBackground} Add values to Dictionary & openWith.Add("txt", "notepad.exe"); \tn % Row Count 23 (+ 2) % Row 25 \SetRowColor{white} & // The Add method throws an exception if the new key is // already in the dictionary. \tn % Row Count 28 (+ 5) % Row 26 \SetRowColor{LightBackground} Retrieve values from Dictionary & String program = openWith{[}"txt"{]}; \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Data Structures and Collections (cont)}} \tn % Row 27 \SetRowColor{LightBackground} Check if value in Dictionary exists & if \seqsplit{(openWith.TryGetValue("tif"}, out value)) \{ \seqsplit{Console.WriteLine("For} key = \textbackslash{}"tif\textbackslash{}", value = \{0\}.", value); \} else \{ \seqsplit{Console.WriteLine("Key} = \textbackslash{}"tif\textbackslash{}" is not found."); \} \tn % Row Count 9 (+ 9) % Row 28 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{{\bf{List}}} \tn % Row Count 10 (+ 1) % Row 29 \SetRowColor{LightBackground} Declare and initialize Object List & List\textless{}Pet\textgreater{} petsList = new List\textless{}Pet\textgreater{}\{ new Pet \{ Name="Barley", Age=8.3 \}, new Pet \{ Name="Boots", Age=4.9 \}, new Pet \{ Name="Whiskers", Age=1.5 \}, new Pet \{ Name="Daisy", Age=4.3 \} \}; \tn % Row Count 23 (+ 13) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{\seqsplit{https://docs.microsoft.com/en-us/dotnet/standard/collections/}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} x{15.543 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Scope}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{this, ref, out, in, return, attributes, propertoes} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{Keywords} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} ref & if the caller passes a local variable expression or an array element access expression, and the called method replaces the object to which the ref parameter refers, then the caller's local variable or the array element now refers to the new object when the method returns \tn % Row Count 10 (+ 8) % Row 3 \SetRowColor{white} & When used in a method's parameter list, the ref keyword indicates that an argument is passed by reference, not by value.\{\{nl\}\}any operation on the parameter is made on the argument \tn % Row Count 15 (+ 5) % Row 4 \SetRowColor{LightBackground} & void Method(ref int refArgument) \{ refArgument = refArgument + 44; \} int number = 1; Method(ref number); \seqsplit{Console.WriteLine(number);} // Output: 45 \tn % Row Count 20 (+ 5) % Row 5 \SetRowColor{white} out & arguments are parsed by reference. any operation on the parameter is made on the argument. It is like the ref keyword, except that ref requires that the variable be initialized before it is passed. It is also like the in keyword, except that in does not allow the called method to modify the argument value. \tn % Row Count 29 (+ 9) % Row 6 \SetRowColor{LightBackground} & It is like the ref keyword, except that ref requires that the variable be initialized before it is passed. It is also like the in keyword, except that in does not allow the called method to modify the argument value \tn % Row Count 35 (+ 6) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} x{15.543 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Scope (cont)}} \tn % Row 7 \SetRowColor{LightBackground} in & The in keyword causes arguments to be passed by reference. It makes the formal parameter an alias for the argument, which must be a variable. In other words, any operation on the parameter is made on the argument. It is like the ref or out keywords, except that in arguments cannot be modified by the called method. Whereas ref arguments may be modified, out arguments must be modified by the called method, and those modifications are observable in the calling context. \tn % Row Count 14 (+ 14) % Row 8 \SetRowColor{white} & the in modifier is usually unnecessary at the call site. It is only required in the method declaration. \tn % Row Count 17 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{A parameter is a variable in a method definition. \newline \newline When a method is called, the arguments are the data you pass into the method's parameters. \newline \newline Parameter is variable in the declaration of function. \newline \newline Argument is the actual value of this variable that gets passed to function.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} p{1.727 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Hierarchy}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.0083 cm} x{12.2617 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Concepts}} \tn % Row 0 \SetRowColor{LightBackground} assembly & An assembly is a file that is automatically generated by the compiler upon successful compilation of every .NET application. It can be either a Dynamic Link Library or an executable file. It is generated only once for an application and upon each subsequent compilation the assembly gets updated. \tn % Row Count 11 (+ 11) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{"Flujo base e intermedio"} \tn % Row Count 12 (+ 1) % Row 2 \SetRowColor{LightBackground} Library & ensemble of functions \tn % Row Count 13 (+ 1) % Row 3 \SetRowColor{white} Struct and Class & Classes and structs are two of the basic constructs of the common type system in the .NET Framework. Each is essentially a data structure that encapsulates a set of data and behaviors that belong together as a logical unit. The data and behaviors are the members of the class or struct, and they include its methods, properties, and events, and so on. \tn % Row Count 26 (+ 13) % Row 4 \SetRowColor{LightBackground} & A class is a reference type. When an object of the class is created, the variable to which the object is assigned holds only a reference to that memory. When the object reference is assigned to a new variable, the new variable refers to the original object. Changes made through one variable are reflected in the other variable because they both refer to the same data. A struct is a value type. When a struct is created, the variable to which the struct is assigned holds the struct's actual data. When the struct is assigned to a new variable, it is copied. The new variable and the original variable therefore contain two separate copies of the same data. Changes made to one copy do not affect the other copy. \tn % Row Count 52 (+ 26) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.0083 cm} x{12.2617 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Concepts (cont)}} \tn % Row 5 \SetRowColor{LightBackground} & In general, classes are used to model more complex behavior, or data that is intended to be modified after a class object is created. Structs are best suited for small data structures that contain primarily data that is not intended to be modified after the struct is created. \tn % Row Count 10 (+ 10) % Row 6 \SetRowColor{white} Delegates & A delegate is a type that represents references to methods with a particular parameter list and return type. When you instantiate a delegate, you can associate its instance with any method with a compatible signature and return type. You can invoke (or call) the method through the delegate instance. Delegates are used to pass methods as arguments to other methods. Event handlers are nothing more than methods that are invoked through delegates. You create a custom method, and a class such as a windows control can call your method when a certain event occurs. The following example shows a delegate declaration: public delegate int PerformCalculation(int x, int y); \tn % Row Count 34 (+ 24) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.0083 cm} x{12.2617 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Concepts (cont)}} \tn % Row 7 \SetRowColor{LightBackground} return & The return statement terminates execution of the method in which it appears and returns control to the calling method. It can also return an optional value. If the method is a void type, the return statement can be omitted. If the return statement is inside a try block, the finally block, if one exists, will be executed before control returns to the calling method. \tn % Row Count 14 (+ 14) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{3.5427 cm} x{7.0854 cm} x{6.2419 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Type Methods}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{IndexOf}} & Reports the zero-based index of the first occurrence of a specified Unicode character or string within this instance. The method returns -1 if the character or string is not found in this instance. & String, Array \tn % Row Count 13 (+ 13) % Row 1 \SetRowColor{white} string & \seqsplit{nameOfString.IndexOf("r"}, 0, \seqsplit{nameOfString.Length);} & \tn % Row Count 17 (+ 4) % Row 2 \SetRowColor{LightBackground} array & int posI = \seqsplit{Array.IndexOf(nameOfArray}, "i"); & \tn % Row Count 20 (+ 3) % Row 3 \SetRowColor{white} {\bf{Equals}} & public virtual bool Equals (object obj);\{\{nl\}\}true if the specified object is equal to the current object; otherwise, false. & \tn % Row Count 28 (+ 8) % Row 4 \SetRowColor{LightBackground} {\bf{Split}} & \seqsplit{https://docs.microsoft.com/en-us/dotnet/api/system.string.split?view=netframework-4.8} & String \tn % Row Count 34 (+ 6) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{3.5427 cm} x{7.0854 cm} x{6.2419 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{17.67cm}}{\bf\textcolor{white}{Type Methods (cont)}} \tn % Row 5 \SetRowColor{LightBackground} {\bf{.ToLower()}} & \seqsplit{https://docs.microsoft.com/en-us/dotnet/api/system.string.tolower?view=netframework-4.8} & String \tn % Row Count 6 (+ 6) % Row 6 \SetRowColor{white} {\bf{.Format}} & \seqsplit{https://docs.microsoft.com/en-us/dotnet/api/system.string.format?view=netframework-4.8\#code-try-18} & String \tn % Row Count 13 (+ 7) % Row 7 \SetRowColor{LightBackground} & \seqsplit{Console.WriteLine("Format} Decimal: \{0:n2\}", num); & cambia el punto flotante (n2 = dos) \tn % Row Count 17 (+ 4) % Row 8 \SetRowColor{white} \mymulticolumn{3}{x{17.67cm}}{{\bf{{\emph{Linq}}}}} \tn % Row Count 18 (+ 1) % Row 9 \SetRowColor{LightBackground} \mymulticolumn{3}{x{17.67cm}}{.GroupBy()} \tn % Row Count 19 (+ 1) % Row 10 \SetRowColor{white} \seqsplit{words.Except(banned)} & \seqsplit{https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.except?view=netframework-4.8} & String \tn % Row Count 25 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{File management}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Write to a Text File} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Write list of strings to a file & string{[}{]} lines = \{ "First line", "Second line", "Third line" \}; \tn % Row Count 5 (+ 4) % Row 2 \SetRowColor{LightBackground} & System.IO.File.WriteAllLines(@"C:\textbackslash{}Users\textbackslash{}Public\textbackslash{}TestFolder\textbackslash{}WriteLines.txt", lines); \tn % Row Count 10 (+ 5) % Row 3 \SetRowColor{white} & // WriteAllLines creates a file, writes a collection of strings to the file, // and then closes the file. You do NOT need to call Flush() or Close(). \tn % Row Count 18 (+ 8) % Row 4 \SetRowColor{LightBackground} Write String to a text file & string text = "A class is the most powerful data type in C\#. Like a structure, " + "a class defines the data and behavior of the data type. "; \tn % Row Count 27 (+ 9) % Row 5 \SetRowColor{white} & // WriteAllText creates a file, writes the specified string to the file, // and then closes the file. You do NOT need to call Flush() or Close(). System.IO.File.WriteAllText(@"C:\textbackslash{}Users\textbackslash{}Public\textbackslash{}TestFolder\textbackslash{}WriteText.txt", text); \tn % Row Count 40 (+ 13) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{File management (cont)}} \tn % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Write only some strings in an array to a file.} \tn % Row Count 1 (+ 1) % Row 7 \SetRowColor{white} // The using statement automatically flushes AND CLOSES the stream and calls // IDisposable.Dispose on the stream object. // NOTE: do not use FileStream for text files because it writes bytes, but StreamWriter // encodes the output as text. & using \seqsplit{(System.IO.StreamWriter} file = new System.IO.StreamWriter(@"C:\textbackslash{}Users\textbackslash{}Public\textbackslash{}TestFolder\textbackslash{}WriteLines2.txt")) \{ foreach (string line in lines) \{ // If the line doesn't contain the word 'Second', write the line to the file. if (!line.Contains("Second")) \{ \seqsplit{file.WriteLine(line);} \} \} \} \tn % Row Count 23 (+ 22) % Row 8 \SetRowColor{LightBackground} Append new text to an existing file. & // The using statement automatically flushes AND CLOSES the stream and calls // IDisposable.Dispose on the stream object. using \seqsplit{(System.IO.StreamWriter} file = new System.IO.StreamWriter(@"C:\textbackslash{}Users\textbackslash{}Public\textbackslash{}TestFolder\textbackslash{}WriteLines2.txt", true)) \{ \seqsplit{file.WriteLine("Fourth} line"); \} \} \tn % Row Count 40 (+ 17) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Read Text from a File}} \tn % Row 0 \SetRowColor{LightBackground} Read the file as one string & string text = System.IO.File.ReadAllText(@"C:\textbackslash{}Users\textbackslash{}Public\textbackslash{}TestFolder\textbackslash{}WriteText.txt"); \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} & \seqsplit{System.Console.WriteLine("Contents} of WriteText.txt = \{0\}", text); \tn % Row Count 9 (+ 4) % Row 2 \SetRowColor{LightBackground} Read each line of the file into a string array. Each element of the array is one line of the file. & string{[}{]} lines = System.IO.File.ReadAllLines(@"C:\textbackslash{}Users\textbackslash{}Public\textbackslash{}TestFolder\textbackslash{}WriteLines2.txt"); \tn % Row Count 14 (+ 5) % Row 3 \SetRowColor{white} & \seqsplit{System.Console.WriteLine("Contents} of WriteLines2.txt = "); \{\{nl\}\}foreach (string line in lines)\{ \{\{nl\}\} Console.WriteLine("\textbackslash{}t" + line); \{\{nl\}\} \} \tn % Row Count 23 (+ 9) % Row 4 \SetRowColor{LightBackground} & Console.WriteLine("\textbackslash{}t" + line); \tn % Row Count 26 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{5.5264 cm} x{11.7436 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Variable declaration}} \tn % Row 0 \SetRowColor{LightBackground} const & You use the const keyword to declare a constant field or a constant local. Constant fields and locals aren't variables and may not be modified. Constants can be numbers, Boolean values, strings, or a null reference. Don't create a constant to represent information that you expect to change at any time. \tn % Row Count 12 (+ 12) % Row 1 \SetRowColor{white} casting & double r = 2.0; int n = 1; n = (int) r \tn % Row Count 14 (+ 2) % Row 2 \SetRowColor{LightBackground} explicit conversion & String cadena ="5"; float variable\_flotante = float.Parse(cadena); int numero\_entero = int.Parse(cadena); char var\_car = char.Parse(cadena); \tn % Row Count 20 (+ 6) % Row 3 \SetRowColor{white} \&\& & returns the boolean value TRUE if both operands are TRUE and returns FALSE otherwise. The operands are implicitly converted to type bool prior to evaluation, and the result is of type bool. \tn % Row Count 28 (+ 8) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{2.5905 cm} x{14.6795 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Repetition structures}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{foreach} & foreach( int number in numbers)\{ Console.Write(\$"\textbackslash{}t\{number\}")\} \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Inheritance}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{C\# and .NET support single inheritance only. That is, a class can only inherit from a single class.} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Not all members of a base class are inherited by derived classes. & Static constructors, which initialize the static data of a class. \{\{nl\}\}Instance constructors, which you call to create a new instance of the class. \{\{nl\}\}Each class must define its own constructors. \{\{nl\}\}Finalizers, which are called by the runtime's garbage collector to destroy instances of a class. \tn % Row Count 18 (+ 16) % Row 2 \SetRowColor{LightBackground} public class C : A & //C inherits from A \tn % Row Count 19 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Operators}} \tn % Row 0 \SetRowColor{LightBackground} int a = 10, b = 3; \{\{nl\}\} d = a+b++; \{\{nl\}\} e = ++a-b; & a = 10, b = 3, d = null \{\{nl\}\}a = 10, b= 3, d = 13\{\{nl\}\}a = 11, d = 4, e = 7 \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} ! & calcula la negación lógica de su operando. Es decir, genera true, si el operando se evalúa como false, y false, si el operando se evalúa como true: \tn % Row Count 12 (+ 8) % Row 2 \SetRowColor{LightBackground} \& & El operador \& calcula el operador AND lógico de sus operandos. El resultado de x \& y es true si x y y se evalúan como true. De lo contrario, el resultado es false. \tn % Row Count 21 (+ 9) % Row 3 \SetRowColor{white} \textasciicircum{} & The \textasciicircum{} operator computes the logical exclusive OR, also known as the logical XOR, of its operands. The result of x \textasciicircum{} y is true if x evaluates to true and y evaluates to false, or x evaluates to false and y evaluates to true. Otherwise, the result is false. That is, for the bool operands, the \textasciicircum{} operator computes the same result as the inequality operator !=. \tn % Row Count 39 (+ 18) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Operators (cont)}} \tn % Row 4 \SetRowColor{LightBackground} | & The | operator computes the logical OR of its operands. The result of x | y is true if either x or y evaluates to true. Otherwise, the result is false. The | operator evaluates both operands even if the left-hand operand evaluates to true, so that the result must be true regardless of the value of the right-hand operand. \tn % Row Count 17 (+ 17) % Row 5 \SetRowColor{white} \&\& & computes the logical AND of its operands. The result of x \&\& y is true if both x and y evaluate to true. Otherwise, the result is false. If x evaluates to false, y is not evaluated. \tn % Row Count 27 (+ 10) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{\seqsplit{https://docs.microsoft.com/es-es/dotnet/csharp/language-reference/operators/boolean-logical-operators\#logical-negation-operator-} \newline https://docs.microsoft.com/es-es/dotnet/csharp/language-reference/operators/arithmetic-operators} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{3.454 cm} x{13.816 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Methods}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{Function} & returns a value \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \seqsplit{Procedure} & executes commands \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} Method & subroutine associated with an object in OO \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{Subroutine} & returns multiple values \tn % Row Count 7 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} p{1.727 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Compiled and Structured langauges}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Tanto compiladores como interpretadores son programas que convierten el código que escribes a lenguaje de máquina.} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{Lenguaje de máquina son las instrucciones que entiende el computador (el procesador para ser más exactos) en código binario (unos y ceros).} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{La principal diferencia entre un lenguaje compilado y uno interpretado es que el lenguaje compilado requiere un paso adicional antes de ser ejecutado, la compilación, que convierte el código que escribes a lenguaje de máquina. Un lenguaje interpretado, por otro lado, es convertido a lenguaje de máquina a medida que es ejecutado.} \tn % Row Count 13 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} p{1.727 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Documentation}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Comments} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{//} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{/{\emph{ }}/} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{/{\emph{ \textless{}summary\textgreater{} \textless{}/summary\textgreater{} }}/} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} x{15.543 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Selection statements}} \tn % Row 0 \SetRowColor{LightBackground} case & int caseSwitch = 1; switch (caseSwitch) \{ case 1: Console.WriteLine("Case 1"); break; case 2: Console.WriteLine("Case 2"); break; default: \seqsplit{Console.WriteLine("Default} case"); break; \} \tn % Row Count 9 (+ 9) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{8.635 cm} x{8.635 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Classes}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{Random} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} var rand = new Random(); & // Instantiate random number generator using system-supplied value as seed. \tn % Row Count 5 (+ 4) % Row 2 \SetRowColor{LightBackground} // Generate and display 5 random byte (integer) values. & var bytes = new byte{[}5{]}; \seqsplit{rand.NextBytes(bytes);} \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} // Generate and display 5 random integers between 0 and 100. & for (int ctr = 0; ctr \textless{}= 4; ctr++) Console.Write("\{0,8:N0\}", rand.Next(101)); \seqsplit{Console.WriteLine();} \tn % Row Count 14 (+ 6) % Row 4 \SetRowColor{LightBackground} // Generate and display 5 random integers. & \seqsplit{Console.WriteLine("Five} random integer values:"); for (int ctr = 0; ctr \textless{}= 4; ctr++) Console.Write("\{0,15:N0\}", rand.Next()); \seqsplit{Console.WriteLine();} \tn % Row Count 22 (+ 8) % Row 5 \SetRowColor{white} Obtener doubles según rango & rand.NextDouble() * 5 \tn % Row Count 24 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{\seqsplit{https://docs.microsoft.com/en-us/dotnet/api/system.random?view=netframework-4.8}} \tn % Row Count 26 (+ 2) % Row 7 \SetRowColor{white} \mymulticolumn{2}{x{17.67cm}}{-} \tn % Row Count 27 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{17.67cm}}{1,5 will generate 4 random numbers} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} x{15.543 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Loops}} \tn % Row 0 \SetRowColor{LightBackground} & foreach(var c in J) \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} & for(int i =0; i \textless{} s.Length; i++) \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} & while(c \textgreater{}10) \tn % Row Count 3 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \end{document}