0
0
C Sharp (C#)programming~15 mins

String concatenation behavior in C Sharp (C#) - Mini Project: Build & Apply

Choose your learning style9 modes available
String concatenation behavior
📖 Scenario: Imagine you are creating a simple program to combine parts of a person's full name. You want to see how strings join together in C#.
🎯 Goal: Build a program that creates separate string parts of a name, then joins them using string concatenation, and finally prints the full name.
📋 What You'll Learn
Create string variables with exact values
Use a string variable to hold a space character
Concatenate strings using the + operator
Print the final concatenated string
💡 Why This Matters
🌍 Real World
Combining strings is common when building full names, addresses, or messages in software.
💼 Career
Understanding string concatenation helps in formatting output, creating user-friendly text, and preparing data for display.
Progress0 / 4 steps
1
Create string parts of a name
Create three string variables called firstName, middleName, and lastName with these exact values: "John", "Fitzgerald", and "Kennedy" respectively.
C Sharp (C#)
Need a hint?

Use string type and assign the exact text with double quotes.

2
Create a space string variable
Create a string variable called space and set it to a single space character " ".
C Sharp (C#)
Need a hint?

This variable will help add spaces between names when joining.

3
Concatenate the full name
Create a string variable called fullName that joins firstName, space, middleName, space, and lastName using the + operator.
C Sharp (C#)
Need a hint?

Use the + operator to join strings in the correct order.

4
Print the full name
Write a Console.WriteLine statement to print the fullName variable.
C Sharp (C#)
Need a hint?

Use Console.WriteLine(fullName); to show the result on the screen.