Login
7 branches 0 tags
Ben (RPI 4) Made NaN and INF into exceptions c928f43 4 years ago 143 Commits
nujel / stdlib / string.nuj
; Some nujel string λs

[def br [λ [num]
	"Return NUM=1 linebreaks"
	[if [or [nil? num] [<= [int num] 1]]
	    "\n"
	    ["\n" [br [-- num]]]]
]]

[def path/without-extension [λ [path]
	"Return PATH, but without the fileextension part"
	[def last-period [last-index-of path "."]]
	[if [>= last-period 0]
	    [substr path 0 last-period]
	    path]
]]