Case sensitivity


In computers, case sensitivity defines whether uppercase and lowercase letters are treated as distinct or equivalent. For instance, when users interested in learning about dogs search an e-book, "dog" and "Dog" are of the same significance to them. Thus, they request a case-insensitive search. But when they search an online encyclopedia for information about the United Nations, they may prefer a case-sensitive search.

Areas of significance

Case sensitivity may differ depending on the situation:
Some programming languages are case-sensitive for their identifiers. Others are case-insensitive, such as ABAP, Ada, most BASICs, Fortran, SQL and Pascal. There are also languages, such as Haskell, Prolog, and Go, in which the capitalisation of an identifier encodes information about its semantics. Some other programming languages have varying case-sensitivity; in PHP, for example, variable names are case-sensitive but function names are not case sensitive. This means that if you define a function in lowercase, you can call it in uppercase, but if you define a variable in lowercase, you cannot refer to it in uppercase. Nim is case-insensitive and ignores underscores, as long as the first characters match.

In text search

A text search operation could be case-sensitive or case-insensitive, depending on the system, application, or context. The user can in many cases specify whether a search is sensitive to case, e.g. in most text editors, word processors, and Web browsers. A case-insensitive search is more comprehensive, finding "Language", "language", and "LANGUAGE" ; a case-sensitive search will find the computer language "BASIC" but exclude most of the many unwanted instances of the word. For example, the Google Search engine is basically case-insensitive, with no option for case-sensitive search. In Oracle SQL most operations and searches are case-sensitive by default, while in most other DBMS's SQL searches are case-insensitive by default.
Case-insensitive operations are sometimes said to fold case, from the idea of folding the character code table so that upper- and lowercase letters coincide.

In filesystems

In filesystems in Unix-like systems, filenames are usually case-sensitive. MacOS is somewhat unusual in that, by default, it uses HFS+ in a case-insensitive but case-preserving mode by default. This causes some issues for developers and power users, because most other environments are case-sensitive, but many Mac Installers fail on case-sensitive file systems.
The older Microsoft Windows filesystems VFAT and FAT32 are not case-sensitive, but are case-preserving. The earlier FAT12 filesystem was case-insensitive and not case-preserving, so that a file whose name is entered as readme.txt or ReadMe.txt is saved as README.TXT. Later Windows file systems such as NTFS are internally case-sensitive, and a readme.txt and a Readme.txt can coexist in the same directory. However, for practical purposes filenames behave as case-insensitive as far as users and most software are concerned.