to check the string is palindrome or not in open edge progress 4gl

Status
Not open for further replies.
C

chaitanya mutyala

Guest
how to check whether the given string is palindrome or not in open edge progress 4gl ,is there any reverse string function inbuilt with progress 4gl? FUNCTION reverseString RETURNS CHARACTER ( INPUT i_c AS CHARACTER ):

DEFINE VARIABLE cresult AS CHARACTER NO-UNDO. DEFINE VARIABLE ii AS INTEGER NO-UNDO.

DO ii = LENGTH( i_c ) TO 1 BY -1: cresult = cresult + SUBSTRING( i_c, ii, 1 ). END. RETURN cresult.

END FUNCTION.

display reverseString( "asdf" ).

Continue reading...
 
Status
Not open for further replies.
Top