You can’t do that in the template code, because when it is parsed on the server, the server doesn’t know what device it will be displayed on.
However, the IPS framework has CSS classed to achieve this, so while both statements would be in the HTML code for everyone, one part could show on mobile devices only and another one only on desktop.