Part-1: http://newdelhipowershellusergroup.blogspot.com/2012/01/part-1-text-manipulation-in-powershell.html
Hi,
In part-1 of text manipulation we saw how to use .Trim(),.TrimStart() and TrimEnd() method. Today we will see how to use .ToLower and ToUpper() Method.
Lets start
we are using the same text which we used in part-1 and saving the text in a variable $text
$text = "The Quick brown fox jumps over the lazy dog"
.ToLower()
When we use ToLower() method it convert the whole string in lowercase.
Check first what $text contains. and it contains the text which we provide to variable $text
When we run the $text.ToLower() it converted the whole string in to lower case.
Let’s compare it with original one. You can see it converted the whole string to lower case {actually “T” in “The” and “Q” in “Quick” is uppercase in original text}
ToUpper()
The ToUpper() method convert the whole string in to uppercase.
$text.ToUpper()
You can see that the whole string in converted to UPPER CASE :)
let compare it with our original text.
Happy????? :)
I hope it helps someone :)
Thanks
Aman Dhally
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.