Login
7 branches 0 tags
Ben (X13/Arch) Moved some code around 9abf891 4 years ago 98 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 [str/last-index-of path "."]]
	[if [>= last-period 0]
	    [str/substr path 0 last-period]
	    path]
]]