There's actually another method, but I don't really recommend it here. It may help in other situations.
When you do a solid element subtraction from something (the slab here), you can indicate that the subtracted faces get the material of the operator.
So, consider a slab into which you are cutting a hole for stairs. If the outside edge of the slab is brick for example (you are doing a crude core model without veneers for your walls) - and you cut a hole in the slab using the conventional method (slab selected, slab tool active, drag a rectangle to cut hole) - the edges of the hole will be brick.
But, if you want the edges of the hole to be white paint, you can subtract a big white paint slab from the first slab with 'use materials of operator'.
So, similarly - in this case - you can trim the edge of a slab with two different operators to apply two materials to the resulting edge.
Attached screenshot shows in foreground, two operators on the edge of an extended slab (resulting in the desired size) - one cube had white edges, the other had red. In the distance is the same sized slab with a normal hole (brick edges) and a hole cut via SEOp with a white slab - leaving white edges for the hole.
HTH,
Karl
One of the forum moderators
AC 28 USA and earlier • macOS Sonoma 14.7.1, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB