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

From Coder Merlin
Line 1: Line 1:
== Print characters in uppercase or lowercase ==
= Print characters in uppercase or lowercase =
 
== Swift ==
<syntaxhighlight lang="swift">
<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!"
Line 5: Line 7:
print(string.lowercased())
print(string.lowercased())
</syntaxhighlight>
</syntaxhighlight>
== Python ==

Revision as of 17:20, 24 December 2018

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

Print characters in uppercase or lowercase[edit]

Swift[edit]

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

Python[edit]