# (strcase string \[flag\]) [GstarCAD 2011](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md) <a id="283"></a> ## (strcase string \[flag\]) --- Convert this string to all upper- or all lower-case. --- This function converts text in a *string* to all upper-case or all lower-case (when *flag* is non-nil). The case to be converted is specified by the *flag* argument. When omitted or set to nil, all characters are converted to upper-case. When not nil (T is typically used), all alphabetic characters are converted to lower-case. ### Examples | Code | Returns | | --- | --- | | (**strcase** "Yes") | YES | | (**strcase** "NO" T) | "no" | | (setq var (**strcase** var)) | Permanently changes variable. | | (if (\= (**strcase** var) "YES") (...) | Temporarily checks variable. | **NOTE** LISP functions that check and compare text tend to be case-sensitive. For example, (if (\= "Y" ans) ...) only works with a capital "Y"; a lowercase "y" is not considered the same. For this reason, it is useful to apply the **strcase** function to the user's response, as follows: (setq ans (getchar)) (setq ans (**strcase** ans)) (if (\= "Y" ans)      ... ) **Tell me about...** [(atof string)](IDR_LISP_B131.md) [(atoi string)](%28atoi%20string%29.md) [LISP Compatibility](../LISP%20Compatibility.md) [Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md) <a id="holding"></a> ## Other versions with matching text [GstarCAD 2012](../../../../2012/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28strcase%20string%20-flag-%29.md)