function trim(S){if(S==null)return;S=S.replace(/^\s\s*/,'').replace(/\s\s*$/, '');return S;} 
