1. Built-in Functions in Pseudocode
Built-in functions are pre-defined functions that provide common operations for string manipulation, type conversion, and character handling. These functions are available by default and can be used without declaring them first.
2. String Length and Manipulation
LENGTH Function
Returns the number of characters in a string.
Syntax:
Example:
LEFT Function
Extracts a specified number of characters from the beginning of a string.
Syntax:
Example:
RIGHT Function
Extracts a specified number of characters from the end of a string.
Syntax:
Example:
MID Function
Extracts a substring of specified length starting from a given position.
Syntax:
Example:
3. Case Conversion
LCASE and UCASE Functions
Convert a single character to lower or upper case.
Syntax:
Example:
TO_UPPER and TO_LOWER Functions
Convert all characters in a string to upper or lower case.
Syntax:
Example:
4. Type Conversion
NUM_TO_STRING Function
Converts a number (INTEGER or REAL) to its string representation.
Syntax:
Example:
STRING_TO_NUM Function
Converts a string to its numeric representation.
Syntax:
Example:
INT Function
Returns the integer part of a real number.
Syntax:
Example:
5. Character Conversion
ASC Function
Returns the ASCII value of a character.
Syntax:
Example:
CHR Function
Returns the character corresponding to an ASCII value.
Syntax:
Example:
6. Summary
Built-in functions provide essential operations for:
- String manipulation (LENGTH, LEFT, RIGHT, MID)
- Case conversion (LCASE, UCASE, TO_UPPER, TO_LOWER)
- Type conversion (NUM_TO_STRING, STRING_TO_NUM, INT)
- Character conversion (ASC, CHR)
These functions are immediately available for use in your pseudocode and help simplify common programming tasks. Understanding and using these built-in functions effectively will make your pseudocode more concise and easier to write.