30+ String Manipulation Techniques in C#



30+ String Manipulation Techniques in C#

30+ String Manipulation Techniques in C#

Strings are a fairly basic part of C#. In fact, you usually learn how to work with strings the first time you create an application in C#. However, there are a lot of ways to work with strings, and often quite a few of those methods are overlooked. So in this video, we are going to look at over 30 ways we can tweak, change, manipulate, and use strings in our applications. I am going to guess that even seasoned veterans are going to find a few things in here that they didn’t know. Keep track of how many you didn’t know about or that you forgot about and let me know at the end.

Source Code: https://leadmagnets.app/?Resource=StringManipulations
Patreon: https://www.patreon.com/IAmTimCorey
Mailing List: https://signup.iamtimcorey.com/
Purchase Courses: https://iamtimcorey.com

0:00 – Intro
1:10 – Demo console app
4:17 – String to lower case
5:03 – String to upper case
5:21 – Title case
8:37 – String as an array of characters
10:47 – Escape characters
13:24 – String Literal
14:47 – String Concatenation / appending strings:
16:55 – Format()
18:21 – String Interpolation
21:46 – String Concatenation performance
23:19 – Interpolation and Literal
27:47 – String memory and time usage with Concatenation
37:27 – String memory and time usage with StringBuilder
41:30 – Converting Array to String: Concat()
43:09 – Converting Array to String: Join()
44:08 – Converting String to Array: Split()
47:08 – Remove String whitespace: Trim()
50:26 – Padding a String: Pad()
54:34 – Searching methods: StartsWith()
57:46 – Searching methods: EndsWith()
59:37 – Searching methods: Contains()
1:01:18 – Searching methods: IndexOf()
1:04:11 – Searching methods: LastIndexOf()
1:08:30 – Allow nullable Strings in your application
1:10:40 – Comparing Strings: CompareTo() / allows one string to be null
1:16:56 – Comparing Strings: String.CompareTo() / allows both strings to be null
1:20:24 – Comparing String Equality: Equals() and ==
1:29:30 – Retrieve part of a String: Substring();
1:32:40 – Replace part of a String: Replace();
1:37:08 – Insert text in a String: Insert();
1:39:11 – Remove text form a String: Remove();
1:41:40 – Summary and concluding remarks

Thanks to Ralfs HBK for the chapter breakdown!

Comments are closed.