This is attributed by Diogenes Laërtius in his Lives and Opinions of Eminent Philosophers (circa 3rd Century CE) to the great Cynic, Diogenes of Sinope. Caught in an act of public indecency, Diogenes is reported to have responded.
εἴθε ἦν, καὶ τὴν κοιλίαν παρατριψάμενον τοῦ λιμοῦ παύσασθαι·
“If only it were so easy to banish hunger by rubbing the belly.”