code: public static String addParam( String url, String paramName, String paramVal )
      {
          return url + ( url.indexOf( '?' ) != -1 ? '&' : '?' ) + paramName + '=' + paramVal;
      }
docs: Add a parameter to the given URL. Assumes there is no trailing
  anchor/fragment indicated with a '#'.
  
  @param url       the URL to which to append.
  @param paramName the name of the parameter to add.
  @param paramVal  the value of the parameter to add.
  @return the URL, with the given parameter added.