magnetic field lines can be entirely confined within the core of a toroid but not within a straight solenoid. Why?
Please explain me first the meaning of the question and then the answer
a torroid is a circular solenoid.
magnetic field is generated due to current flowing in the torroid and solenoid. In a torroid it is concentreted only within the core while in a solenoid it is like that of a bar magnet
the reason for this is that in torroid everywhere except the core, the magnetic field due to individual wire turns cancel out.
in solenoid, magnetic field due to individual wire turns cancel longitudinally but they add up horizontally. so, magnetic field exists even outside the core.
That's where toroid kind of wins in containing a field inside it . Inside toroid , the magnetic field forms a perfect loop (no field leaking).