tolower, _mbctolower, towlower
Aus RAD Studio (Deutsch)
Nach oben zu ctype.h - Index
Header-Datei
ctype.h, mbstring.h
Kategorie
Konvertierungsroutinen
Prototyp
int tolower(int ch);
int towlower(wint_t ch); // Unicode-Version
unsigned int _mbctolower(unsigned int c);
Beschreibung
Konvertiert Zeichen in Kleinbuchstaben.
tolower ist eine Funktion, die einen Integerwert ch (im Bereich von EOF bis 255) in den Wert des entsprechenden Kleinbuchstabens konvertiert (bei den Großbuchstaben A bis Z also a bis z). Alle anderen Werte bleiben unverändert.
Rückgabewert
tolower gibt den konvertierten Wert von ch zurück, wenn ch ein Großbuchstabe ist. Alle anderen Werte werden unverändert zurückgegeben.
Beispiel
#include <string.h> #include <stdio.h> #include <ctype.h> int main(void) { int length, i; char *string = "THIS IS A STRING"; length = strlen(string); for (i=0; i<length; i++) { string[i] = tolower(string[i]); } printf("%s\n",string); return 0; }
Portabilität
| POSIX | Win32 | ANSI C | ANSI C++ | |
|---|---|---|---|---|
|
tolower |
+ |
+ |
+ |
+ |
|
_mbctolower |
+ |
|||
|
towlower |
+ |
+ |
+ |