By injecting a zero-width space ​
at the desired location.
This technique is very useful for indicating multiple possible break locations for a contiguous string, even if the room is big enough to accommodate the entire string, because the zero-width spaces are invisible. If, however, a break is needed, the rendering knows to break the string at a space, and a zero-width space is treated as a space.
In the classroom I use the example of a URI string, where adding a zero-width space after every /
will render as a regular URI (without visible spaces) and yet will break at the desired points if necessary.