Difference between revisions of "Code Snippet: Changing Character Case"

From Coder Merlin
(Created page with "let string = "For the world is hollow, and I have touched the sky!" print(string.uppercased()) print(string.lowercased())")
 
Line 1: Line 1:
== Print characters in uppercase or lowercase ==
<syntaxhighlight lang="swift">
let string = "For the world is hollow, and I have touched the sky!"
let string = "For the world is hollow, and I have touched the sky!"
print(string.uppercased())
print(string.uppercased())
print(string.lowercased())
print(string.lowercased())
</syntaxhighlight>

Revision as of 10:15, 5 December 2018

Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Print characters in uppercase or lowercase[edit]

let string = "For the world is hollow, and I have touched the sky!"
print(string.uppercased())
print(string.lowercased())