Login
7 branches 0 tags
Ben (Mac) Increased [cat] buffersize from 8K -> 1M d5be101 4 years ago 52 Commits
nujel / stdlib / string.nuj
; Some nujel string λs

[def br [λ [&num]
	"Return NUM=1 linebreaks"
	[cond [[or [nil? &num] [<= [int &num] 1]] "\n"]
	      [#t ["\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]
]]