implement trim
add test for trim
add test with custom char, and fix regexp