Q(uick)BASIC Function: LCASE$

Quick View

LCASE$

A string processing function that returns a string expression with all letters in lower-case

Worth knowing

Useful and cross-version information about the programming environments of QBasic and QuickBasic.

Syntax
  • LCASE$(stringexpression$)
  • UCASE$(stringexpression$)
Description/Parameter(s)
stringexpression$ Any string expression.
Example
Test$ = "THE string" PRINT Test$ PRINT LCASE$(Test$); " in lowercase" PRINT UCASE$(Test$); " IN UPPERCASE"
Syntax
  • LCASE$(stringexpression)
Description/Parameter(s)

The LCASE$ function takes a string variable, string constant, or string expression as its single argument.

LCASE$ works with both variable- and fixed-length strings.

LCASE$ and UCASE$ are helpful in string comparison operations where tests need to be case insensitive.

Example

This example converts uppercase characters in a string to lowercase.

' Program to convert to lowercase. CLS ' Clear screen READ Word$ PRINT LCASE$(Word$); DATA "THIS IS THE STRING in lower case."

Sample Output:

this is the string in lower case.

See also:

Syntax
  • LCASE$(stringexpression$)
Description/Parameter(s)

Usage Notes

  • LCASE$ and UCASE$ are helpful in string-comparison operations that are not case sensitive.
Example

This example uses the LCASE$ function to convert uppercase characters in a string to lowercase characters.

CLS 'Clear screen. READ Word$ PRINT LCASE$(Word$); DATA "THIS IS THE STRING in lower case."

Sample Output:

this is the string in lower case.

See also: