I have if else condition in one function in oracle
i need to convert that into c# code please help.
IF INSTR( pString, pSeparator, -1, 1) != ( LENGTH( RTRIM( pString )) - LENGTH( pSeparator ) + 1 )
THEN
-- There isn't one at the end so add it
l_Return := pString || pSeparator;
--DBMS_OUTPUT.PUT_LINE('Did not find seperator - ADDING');
In this case you can use
string.EndsWith()instead, that’s exactly what you are trying to check: