Book Image

Learn C# in 7 days

By : Gaurav Aroraa
1 (1)
Book Image

Learn C# in 7 days

1 (1)
By: Gaurav Aroraa

Overview of this book

This book takes a unique approach to teach C# to absolute beginners. You’ll learn the basics of the language in seven days. It takes a practical approach to explain the important concepts that build the foundation of the C# programming language. The book begins by teaching you the basic fundamentals using real-world practical examples and gets you acquainted with C# programming. We cover some important features and nuances of the language in a hands-on way, helping you grasp the concepts in a fluid manner. Later, you’ll explore the concepts of Object-Oriented Programming (OOP) through a real-world example. Then we dive into advanced-level concepts such as generics and collections, and you’ll get acquainted with objects and LINQ. Towards the end, you’ll build an application that covers all the concepts explained in the book. By the end of this book, you will have next-level skills and a good knowledge of the fundamentals of C#.
Table of Contents (15 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Arrays and string manipulations


Arrays and strings are important in C# programming. There may be chances when you need string manipulation or play with complex data using arrays. In this section, we will discuss arrays and strings.

Arrays

An array is nothing but a data structure that stores fixed-size sequential elements of the same type. Elements of an array that contained data are basically variables, and we can also call an array a collection of variables of the same type, and this type is generally called an element type.

Note

An array is a block of contiguous memory. This block stores everything required for an array, that is, elements, element rank, and length of the array. The first element rank is 0 and the last element rank is equal to the total length of array - 1.

Let's consider the char[] vowels = {'a', 'e', 'i', 'o', 'u'}; array. An array with size five. Every element is stored in a sequential manner and can be accessed using its element rank. The following is the diagram showing...