Domino Code Fragment

Code Name*
JavaScript function trimBlanks
Date*
04/19/2000
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.
Description*
The trimBlanks function is a utility routine that simply takes the field value and trims any extra space values.
Type*
JavaScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
The JavaScript function follows:

                          function trimBlanks ( theString, repChar ) {

                          //this function replaces the spaces in a string with the provided
                         character


                          trimString="";

                          for ( i = 0; i < theString.length; i++) {
                         theChar=theString.substring ( i, i+1);
                         if ( theChar == " ") {


                          trimString += repChar

                          } else {

                          trimString+=theString.substring ( i, i+1);

                          }
                         }
                         return (trimString);
                         }