folly: adding folly::ltrimWhitespace / folly::rtrimWhitespace
Summary:
folly: adding folly::trimWhitespace
extending the idea of folly::skipWhitespace.
the reason for adding it, we want to be able to do:
auto s = skipWhitespace(trimWhitespace(" aaaa "))
very similar to python's strip()
Test Plan:
adding unit tests:
# make ; _bin/folly/test/string_test --gtest_filter="String.whitespace"
# fbmake --ccache off --distcc off dbg -j 16
fbmake dbg -j 16
Fbmake run id: G62i4cDP42U
Note: Google Test filter = String.whitespace
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from String
[ RUN ] String.whitespace
[ OK ] String.whitespace (0 ms)
[----------] 1 test from String (0 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (0 ms total)
[ PASSED ] 1 test.
Reviewed By: ldbrandy@fb.com
Subscribers: ldbrandy, folly-diffs@, yfeldblum, chalfant, azhavnerchik
FB internal diff:
D2109364
Signature: t1:
2109364:
1433192444:
862e237bba1928fcb94be1f95c57a68d457939e9