Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
C# and Algorithmic Thinking for the Complete Beginner

You're reading from  C# and Algorithmic Thinking for the Complete Beginner

Product type Book
Published in Jun 2024
Publisher Packt
ISBN-13 9781836205630
Pages 916 pages
Edition 1st Edition
Languages
Author (1):
Aristides Bouras Aristides Bouras
Profile icon Aristides Bouras
Toc

Table of Contents (11) Chapters close

Preface 1. Part I Introductory Knowledge 2. Part II Getting Started with C# 3. Part III Sequence Control Structures 4. Part IV Decision Control Structures 5. Part V Loop Control Structures 6. Part VI Data Structures in C# 7. Part VII Subprograms 8. Part VIII Object-Oriented Programming 9. Part IX Files 10. Some Final Words from the Author

Chapter 14
Manipulating Strings

14.1 Introduction

Generally speaking, a string is anything that you can type using the keyboard, including letters, symbols (such as &, *, and @), and digits. In C#, a string is always enclosed in double quotes.

Below is a C# program that uses strings.

a = "Everything enclosed in double quotes is a string, even the numbers: ";
b = "3, 54, 731";
Console.WriteLine(a + b);
Console.WriteLine("You can even mix letters, symbols and digits like this: ");
Console.WriteLine("3 + 4 equals 7");

Many times programs deal with data that comes in the form of strings (text). Strings are everywhere—from word processors, to web browsers, to text messaging programs. Many exercises in this book actually make extensive use of strings. Even though C# supports many useful methods for manipulating strings, this chapter covers only those methods that are necessary for this book's purpose. However, if you need even more information...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime