Closed rbwhitaker closed 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.
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:
ReadOnlySpan<byte>
, I may save this for later, even if I do cover it.String instance methods and properties:
foreach
chapter.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 theIsAscii
,IsDigit
,IsLetter
,IsNumber
stuff. This is mentioned later in the book, but it is done as a random hint in a challenge.