Returns the integer value representing the length of a string. The identifier should be of data type string.
Syntax:
LENGTH(stringVariable)
Example:
How many characters does the "Hello world" phrase has? Write an algorithm to output the answer.
numberOfCharacters ← LENGTH("Hello world")
OUTPUT numberOfCharacters
Write an algorithm that asks the user to enter a string and outputs the number of characters that the string entered has.
INPUT str
OUTPUT "The string entered has ", LENTH(str), "characters."
Returns the string/character with all characters in lower case. The identifier should be of data type string or char.
Returns the string/character with all characters in upper case. The identifier should be of data type string or char.
Returns a string of length length starting at position start. The identifier should be of data type string, length and start should be positive and data type integer.
Generally, a start position of 1 is the first character in the string.