trim the flags from value