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
Csharp :: c# if file exists 
Csharp :: Getting data from selected datagridview row and which event 
Csharp :: unity reload scene 
Csharp :: c# error messagebox 
Csharp :: iso date format c# 
Csharp :: change height of rect transform unity 
Csharp :: restclient basic auth c# 
Csharp :: split with multiple delimiters c# 
Csharp :: for loop unity 
Csharp :: how to disable a gameObject unity c# 
Csharp :: linux command line exit with error message 
Csharp :: unity check if key pressed 
Csharp :: hello world c 
Csharp :: unity color set alpha 
Csharp :: unity reload current scene 
Csharp :: c# check if list contains string case insensitive 
Csharp :: c# how to get screen resolution in class 
Csharp :: set text in center wpf 
Csharp :: move in the direction that player is facing unity 
Csharp :: isprime c# 
Csharp :: load scene unity 
Csharp :: c# string to datetime 
Csharp :: keyboard input unity 
Csharp :: backcolor c# hexadecimal 
Csharp :: C# unity link button 
Csharp :: Base64String to stream c# 
Csharp :: c# print array 
Csharp :: application server types in .net 
Csharp :: restart animation unity 
Csharp :: c# thread sleep 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =