FUNCTIONS CORE

RemAll()

Delete a specified character from both sides of a string

Syntax

Signature
RemAll( cString, [xChar] ) --> cResult

Arguments

cString

xChar

Example

RemAll.prg
PROCEDURE Main()

   Check( 'RemAll( "  xDev  " )           ', RemAll( "  xDev  " ), "xDev" )
   Check( 'RemAll( "***Total***", "*" )   ', RemAll( "***Total***", "*" ), "Total" )
   Check( 'RemAll( "--42--", Asc( "-" ) ) ', RemAll( "--42--", Asc( "-" ) ), "42" )

RETURN

STATIC PROCEDURE Check( cTitle, xResult, xExpected )

   QOut( cTitle + IIF( xResult == xExpected, "OK", "ERROR" ) )

RETURN

Output

RemAll( "  xDev  " )           OK
RemAll( "***Total***", "*" )   OK
RemAll( "--42--", Asc( "-" ) ) OK