Trim strings.
Make rules available in your current module.
import trim ;
Trim a string.
test-str = " hello world " ;
left-trimed = [ trim.left $(test-str) ] ;
right-trimed = [ trim.left $(test-str) ] ;
fully-trimed = [ trim.trim $(test-str) ] ;
Trim a shell cmd.
trimmed-result = [ trim.sh $(SHELL-CMD) ] ;
-
rule trim-left-regex ( )
Return regex pattern that matches all but left whitespace.
-
rule trim-right-regex ( )
Return regex pattern that matches all but the right whitespace.
-
rule trim-regex ( )
Return regex pattern that matches all but the left and right whitespace.
-
rule left ( strs * )
Return strs with left most whitespace removed from each item.
-
rule right ( strs * )
Return strs with right most whitespace removed from each item.
-
rule trim ( strs * )
Return strs with left and right whitespace removed from each item.
-
rule sh ( command : * )
Just like Boost.Build's SHELL only left and right whitespace removed from the result.
In the unit-test rule test in source:
trim.jam