X\STRING-

( xc-addr u1 -- xc-addr u2 )

Search for the penultimate xchar in the string xc-addr u1. The string xc-addr u2 contains all xchars of xc-addr u1, but the last. Unlike XCHAR-, X\STRING- can be implemented in encodings where xchar boundaries can only reliably detected when scanning in forward direction.

Implementation:

: X\STRING- ( xc-addr u -- xc-addr u' )
   OVER + XCHAR- OVER - ;

ContributeContributions