Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/src/cmd/4th/lib/startend.4th

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


\ 4tH library - TOOLBELT STARTS?/ENDS? - Copyright 2003,2008 J.L. Bezemer
\ You can redistribute this file and/or modify it under
\ the terms of the GNU General Public License

[UNDEFINED] 2OVER [IF]
[NEEDS lib/2rotover.4th]
[THEN]

[UNDEFINED] COMPARE [IF]
[NEEDS lib/compare.4th]
[THEN]

[UNDEFINED] STARTS? [IF]
( str len pattern len2 -- str len flag )
: STARTS? DUP >R 2OVER R> MIN COMPARE 0= ;
: ENDS? DUP >R 2OVER DUP R> - 0 MAX /STRING COMPARE 0= ;
( str len pattern len2 -- str len flag )
[THEN] 


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].