Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to print a variable in c# with text

string name = "John";
Console.WriteLine("His name is " + name);
// or
Console.WriteLine($"His name is {name}");
// or
Console.WriteLine("His name is ", name);
// or 
Console.WriteLine("His name is {0}", name);
Comment

how to print a variable in c#

using System;

namespace Simple
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("This is C#");
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
:: how to find object by ag unity 
::  
:: c# check if a directory exists 
::  
Csharp ::  
::  
::  
::  
::  
Csharp :: pause audio unity 
::  
::  
Csharp ::  
Csharp :: setup authorize in swagger .net core 
::  
Csharp :: c# unzip files 
:: c# count number of occurrences in string 
:: unity spawn object at position 
:: c# prime factorization 
Csharp ::  
:: unity smooth camera 2d 
::  
:: c# application hangs while running 
::  
Csharp ::  
:: C# socket bind to dns name 
::  
Csharp :: how to turn off sprite renderer in unity 
::  
:: set decimal point c# 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =