The following Javascript function will perform a trim of
a string just like the PowerBuilder equivalent. It makes use of the
regular expression feature of Javascript.
function TrimString(sInString) {
sInString = sInString.replace( /^\s+/g, "" );// strip leading
return sInString.replace( /\s+$/g, "" );// strip trailing
} |