Chapter 9. Bringing Strings into the Limelight

In This Chapter

  • Understanding the ins and outs of strings

  • Manipulating strings

  • Dealing with string positions

  • Altering the case of strings

  • Performing powerful string pattern matches using regular expressions

Whether you're writing e-mail or browsing the Web, you're constantly interacting with some form of text. Besides the spoken word, text is one of the most common ways we communicate with one another. In fact, I'm communicating with you right now through text. Even though computers are really just oversized and overpowered calculators, when it comes to interaction between humans and computers, text is the natural choice for communication. I mean, how useful would it be for the computer to display 1101000 1100101 1101100 1101100 1101111 to greet you instead of writing Hello onscreen?

Interacting with computers by using text is important, which is why displaying, reading, and manipulating text are key features of any programming or scripting language. PowerShell provides all the bells and whistles to make all this work easy for you. In this chapter, you find out just how surprisingly capable PSH is at dealing with and manipulating text. Armed with this knowledge, you'll be parsing, filtering, and doing all kinds of fun stuff with text in no time.

Taking Your First Look at Strings

The technical name for text is string. Although you normally think of text as having some meaning, a string is really nothing more than a consecutive sequence of characters. ...

Get Windows PowerShell™ 2 For Dummies® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.