This example requires the headers <algorithm>, <locale>, and <utility>.
C++11
To trim a sequence or string means to remove all leading and trailing elements (or characters) matching a certain predicate. We first trim the trailing elements, because it doesn't involve moving any el...