define trim function ass a AppMenu class behavior