An Approximation of Hedberg’s Type in Sobolev Spaces with Variable Exponent and Application