Revision 7ae7cfc8-a06b-49ce-86f1-eb0ef8362e2a - Code Golf Stack Exchange
# Java 10, 94 bytes
<!-- language-all: lang-java -->
p->s->{for(var w:s.split(" "))if(w.startsWith(p))System.out.println(w.substring(p.length()));}
Try it online [here][1].
Ungolfed:
p -> s -> { // lambda taking prefix and text as Strings in currying syntax
for(var w:s.split(" ")) // split the String into words (delimited by a space); for each word ...
if(w.startsWith(p)) // ... test whether p is a prefix ...
System.out.println(w.substring(p.length())); // ... if it is, output the suffix
}
[1]: https://tio.run/##TVC7UgMxDKzvvkJzlc0QfwCBa5iho0pBwVAoji848dnGkhMymXz74XswUEkrrXdXPuAJV4fdcbB9DInhULDKbJ3qstdsg1d367qOeeusBu2QCF7RerjW1TIkRi7lFOwO@rISG07W798/ANOe5MisXhaxx3l3D8/BU@5NWgZtC5S7zn4bgicY4qqlVXvtQhInTHB@IEXRWRYNNFLaTpxVcU1Mb5Y/RZRycyE2vQqZVSx67PxIyVua1EVUzvh9oUop17ehqtYl06@hwhjdRTRdQt1IhVqbyDM8lscwNoyO5sbs5lqOQQc6p2S8vvybuT9QuCVL@MV5kQgl1fRlE8qp3Kwx0@j1lS0bwGmD1MiS81bfhh8