Horje
c# method Code Example
c# method
/* --Syntax--
[] = Optional
<> = Required
[modifiers] <return type> <identifier>([<parameter type> <parameter identifier>])
{
  //Code block
  //Return is required if type is not 'void'
  return null;
} */
//Example
/*Modifiers   Return Type	Identifier	Parameters, optional, separate with comma*/
public static bool 			MyFunc		(int x, int y)
{
  	x = x * 2;
    return x > y; //Omittable if return type is void
}
//Shortened to return the given expression |Expression body definition|	
public static int answerToEverything() 		=> 42;
functions c#
public void SayHello(string name) 
{
    Console.WriteLine("Hello");
}

public void SayName()
{
	Console.WriteLine("What is your name?");
	string name = Console.ReadLine(); 
	SayHello(name);
}




Csharp

Related
special characters regex c# Code Example special characters regex c# Code Example
linq query languages Code Example linq query languages Code Example
dsharp emoji from string Code Example dsharp emoji from string Code Example
System.Data.SqlClient.SqlException: 'Execution Timeout Expired. Code Example System.Data.SqlClient.SqlException: 'Execution Timeout Expired. Code Example
blazor use static json files Code Example blazor use static json files Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8