teste

MON_STRG

  • Given a summand written as a string, this function returns the monomial written as a string, for example

gap>MON_STRG("(-10)*U*V");

"U*V"

gap>

MON_STRG:=function(mon)
local pos;
pos:=Position(mon, ')');
if pos in Integers and IsDigitChar(mon[pos-1])=true then
    return mon{[Position(mon, ')') + 2..Size(mon)]};
else
    return mon;
fi;
end;