Inside the String
Explore string fundamentals in C#, including how to initialize and access characters, concatenate strings, and perform string manipulations such as reversing strings, shifting characters, and checking for palindromes. This lesson helps you develop a foundational understanding of handling text data in your C# programs.
Collection
A collection is a general term used to group multiple values into a single unit. We use collections all the time in the real world―a book is a collection of pages, a train is a collection of train cars, and a wardrobe is a collection of clothes.
String
A string is a collection of characters, mostly treated as a single unit. A string is used to store text values like a name, address, message, etc.
Initializing the string
The following program demonstrates the initialization of a string:
In line 5, we declare a string using double quotes "".
Accessing the characters in a string
C# allows us to access individual characters inside a ...