How to make an algorithm to convert case to lowercase?

2

I need an algorithm that accepts a string or literal expression in uppercase or uppercase or lowercase. Example:

leia(nome)

Regardless of the entry:

  

So-and-so, FANO, so-and-so, or FULANO

The output of the code escreva(nome) should be:

  

so and so

    
asked by anonymous 24.10.2014 / 17:40

1 answer

5

Portuguese has a function that treats this, it is the function caracteres_minusculos .

From the documentation (found within the software itself):

  

Library Text with funcao cadeia caracteres_minusculos(cadeia cad)

     

Description: Transforms the characters of a string into lowercase characters

     

Parameters:
  cad: any value of type string
  Returns: the string with the transformed characters

Remember to import the Texto library so that you can use the character conversion function correctly.

Complete example:

programa
{
    inclua biblioteca Texto --> txt
    funcao inicio()
    {
        cadeia texto
        leia(texto)
        escreva("Texto convertido para minúsculo: ", txt.caracteres_minusculos(texto) )
    }
}
    
24.10.2014 / 18:47