rbwhitaker / CSharpPlayersGuideEarlyAccess

A place to track issues with the C# Player's Guide for patches and future editions
18 stars 0 forks source link

New Strings Chapter #671

Closed rbwhitaker closed 1 year ago

rbwhitaker commented 1 year ago

I'm planning on chopping up Level 7 into two levels, one focused on Console and one focused on strings.

I've been feeling for a while that strings deserve a deeper analysis, and this would become the place for that.

The one major reservation I have about this is that the book has not really dealt with instance methods until later. And this would demand it come front and center in this new strings chapter. But I think that's probably okay. By this point in the book, you're probably ready for it, and this gives you a set of string power tools that will serve you well through the rest of the book. (For example, people are constantly mentioning ToLower() in Discord. And... it is only mentioned as a side effect in the section about extension methods.)

So here's a list of things that I'd likely include. First, from the existing content:

New C# 11 features:

String instance methods and properties:

There's also an open question here: should this be a text chapter, rather than a strings chapter? Should I include char stuff?

If I included char stuff, I think the main thing I'd point out is all of the IsAscii, IsDigit, IsLetter, IsNumber stuff. This is mentioned later in the book, but it is done as a random hint in a challenge.

rbwhitaker commented 1 year ago

This chapter now exists, and was put in after arrays, so that it can leverage some of the array features. I've left the string formatting in the console chapter, because I think it is too convenient to wait on, and is most useful in a display situation anyway.