Translate
- Statement converts the case or single characters of the character-type data object text. The statement CASE can be used for the conversion to upper/lower case; USING can be used for the conversion according to a mask. The variable text must be character-type.
- Syntax :
Ex :
- ... USING mask.
Source Code :
PARAMETERS : txt TYPE string.
TRANSLATE txt USING 'AB' .
WRITE : txt.
TRANSLATE txt USING 'AB' .
WRITE : txt.
Input
Output
- This is works similar to replace all occurrences of .
--------------------------------------------------------------------------------------
Ex 2.
- TO LOWER CASE or TO UPPER CASE.
Source Code
PARAMETERS : txt TYPE string.
TRANSLATE txt TO LOWER CASE.
WRITE : txt.
TRANSLATE txt TO LOWER CASE.
WRITE : txt.
No comments:
Post a Comment