About   -   Contact   -   Purchase   -   Search   -   What's New

Javascript Trim a String
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

Top of Page

Legal Notice

Ken Howe 2011