toupper और tolower
toupper हर letter को एक capital में बदलता है और tolower इन्हें small letters में बदलता है, text के लिए एक volume knob की तरह। यह मदद करता है जब आप चाहते हैं words same दिखें।
In this page:
Syntax
toupper(string)
tolower(string)
toupper और tolower
toupper() एक string को सारी uppercase में convert करता है, और tolower() इसे सारी lowercase में convert करता है। दोनों strings के एक vector पर element-wise काम करते हैं। ये आमतौर पर case-insensitive comparisons के लिए दोनों sides को पहले same case में normalize करके इस्तेमाल होते हैं।
Note:
Case-insensitive comparisons के लिए, == से compare करने से पहले tolower() से दोनों strings normalize करें।
उदाहरण: toupper and tolower
text <- "Hello World"
cat(toupper(text), "\n")
cat(tolower(text), "\n")
Login to try C/C++/Java/PHP code in the editor
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the
view already swaps in the hi_ translation fields (or blanks these
out if untranslated), so this renders correctly for both languages
without a lang_code check here. #}
आम गलतियां
- यह उम्मीद करना कि
toupper(text)textबदल देगा, जब यह एक नई string return करता है जब तक आप इसे assign न करें। - case match किए बिना strings compare करना, जैसे
"Yes" == "yes", जोFALSEहै; पहलेtolower()से convert करें। - एक number पर
toupperइस्तेमाल करना और एक string पाना, जब value character बन जाती है।
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: