I think is better add a second parameters to functions for indicate if remove these character or only whitespace, as php does.

Later if i can i'll add.