[SalesForce] Remove first and Last character from string In Formula field

My output in formula field is : [ ref:_5540058J._578sdie5:ref ]

My expected output is :

ref:_5540058J._578sdie5:ref

I tried Trim with Left and Right but it is not giving expected result

Best Answer

Try below function

TRIM(
LEFT(
    TRIM(
        RIGHT(field__c,  (LEN(field__c) - 1) ) 
        ),
        (LEN(field__c) - 3)
    )
)