-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

PowerShell 7 Workshop
By :

Now we understand a bit about typing, and how value types work, we can talk about the other main type of object – reference types. We compared value type objects to primitives in other languages in the previous section, Discovering value types. Reference-type objects are the equivalent of data structures. Reference-type objects only hold a reference in the stack to more data in the heap; this is important because reference-type objects do not have a defined size. In general, a reference type may hold up to 2 GB of data. To prove it, I turned the Shakespeare play Hamlet into a string, by downloading it as a text file from Project Gutenberg:
Figure 4.11 – Stringifying Hamlet
As we can see, there are around 197,000 characters in the whole string.
I did two interesting things there; I used the length
property of the string type to see how long my string was, in characters, but I also used the GetType()
method to...
Change the font size
Change margin width
Change background colour