功能:移除字符串字头或字尾的空白。
str:需要移除的字符串
flag:0:全部移除;1:移除前端;2:移除后端
返回值:移除后的字符串
例:
string str = “ 1123 ”;
str = trim(str,0);//str的值为:”1123”