December 13th, 2012

PowerTip: Adjusting the Case of a String

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to adjust the case of an entire string.

Hey, Scripting Guy! Question How can I adjust the case of an entire string?

Hey, Scripting Guy! Answer Charlotte PowerShell User Group member Brian Wilhite says: One way to adjust the case (upper or lower) of an entire string object is to call the ToUpper or ToLower methods of the string object.

(‘this string should be upper case’).ToUpper()

(‘THIS STRING SHOULD BE LOWER CASE’).ToLower()

 

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.