protected static Ptg calcTrim( Ptg[] operands )
	{
		Object o = operands[0].getValue();
		String res;
		if( o instanceof Double )
		{
			res = ExcelTools.getNumberAsString( (Double) o );
		}
		else
		{
			res = String.valueOf( o );
		}
		if( (res == null) || res.equals( new PtgErr( PtgErr.ERROR_NA ).toString() ) )
		{
			return new PtgErr( PtgErr.ERROR_NA );
		}
		// first let's remove the beginning and trailing spaces.
		if( res.length() > 0 )
		{
			while( res.substring( 0, 1 ).equals( " " ) )
			{
				res = res.substring( 1, res.length() );
			}
			while( res.substring( res.length() - 1, res.length() ).equals( " " ) )
			{
				res = res.substring( 0, res.length() - 1 );
			}
			// now we need to remove double spaces
			while( res.indexOf( "  " ) != -1 )
			{
				int i = res.indexOf( "  " );
				String prestring = res.substring( 0, i );
				String poststring = res.substring( i + 1, res.length() );
				res = prestring + poststring;
			}
		}
		return new PtgStr( res );

	}