Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Letter case
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Methods in programming=== In some forms of [[BASIC]] there are two methods for case conversion: <syntaxhighlight lang="qbasic"> UpperA$ = UCASE$("a") LowerA$ = LCASE$("A") </syntaxhighlight> [[C (programming language)|C]] and [[C++]], as well as any C-like language that conforms to its [[C standard library|standard library]], provide these functions in the file [[ctype.h]]: <syntaxhighlight lang="c"> char upperA = toupper('a'); char lowerA = tolower('A'); </syntaxhighlight> Case conversion is different with different [[character sets]]. In [[ASCII]] or [[EBCDIC]], case can be converted in the following way, in C: <syntaxhighlight lang="c"> int toupper(int c) { return islower(c) ? c β 'a' + 'A' : c; } int tolower(int c) { return isupper(c) ? c β 'A' + 'a' : c; } </syntaxhighlight> This only works because the letters of upper and lower cases are spaced out equally. In ASCII they are consecutive, whereas with EBCDIC they are not; nonetheless the upper-case letters are arranged in the same pattern and with the same gaps as are the lower-case letters, so the technique still works. Some computer programming languages offer facilities for converting text to a form in which all words are capitalised. [[Visual Basic]] calls this "proper case"; [[Python (programming language)|Python]] calls it "title case". This differs from usual [[Capitalization#Title case|title casing]] conventions, such as the English convention in which minor words are not capitalised.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)