Programming in Any Language
C# Text Processing - Lessons
The Character (char) Data Type
The Char data type gives you access to individual characters in a string. This is the first step being able to manipulate strings. C# has a rich collection of tools to make all this happen. PDFs: Slides; Program Code
Substring Overview
The following video is an overview of all the methods you can use to manipulate strings. This video will be followed by a series of videos showing you how to use each method effectively. I’m doing each video separately because these are the things you’ll want to come back to and refer to individually when writing code. Some of these methods you’ll use rarely so you don’t want them cluttering up your brain. The ones you use regularly will become a part of your programming style. They’ll stick with you. PDF: Slides
Videos of Each Method
The Contains method allows you to find a substring within a larger string. PDF: Code
The Substring method returns a portion of the target string beginning with a starting position. PDF: Code
The Insert method allows you to place characters, a string, inside the target string at a specific position. PDF: Code
The Remove method allows us to remove a substring from the larger string leaving us with whatever is left. PDF: Code
Trim(), TrimStart() and TrimEnd(). These methods remove leading spaces, trailing spaces, or both from a string. PDF: Code