, , - . , , , , , , . , , / .
function $trim(required string, string customChar=" "){
var result = arguments.string;
var char = len(arguments.customChar) ? left(arguments.customChar, 1) : ' ';
char = reEscape(char);
result = REReplace(result, "#char#+$", "", "ALL");
result = REReplace(result, "^#char#+", "", "ALL");
return result;
}
, - :
string = "0000foobar0000";
string = $trim(string, "0");
//string now "foobar"
, - :)