/* Prepends given string to the stored string.

If given argument is not a string or a String instance, an
InvalidArgumentException is thrown.

Returns this instance.

TODO: Examples
500773
public function prependF ($string)
	{
		ensure('Argument', $string, 'is_a_string', __CLASS__, __METHOD__);

		if ($string instanceof self) {
			$string = $string->to_s();
		}

		$this->string = $string . $this->string;

		return $this;
	}
689627
def append(self, name):
        """"""

        if not isinstance(name, str):
            raise TypeError(
                    "argument 'name' must be a string, not {}".format(
                        name.__class__.__name__
                        )
                    )

        if not name:
            raise ValueError("argument 'name' cannot be empty")

        if not name in self.__map:
            self.__map[name] = IdRangeSet()
488645
def prepend_child(node)
      raise "argument to << must be a String or Ox::Node." unless node.is_a?(String) or node.is_a?(Node)
      @nodes = [] if !instance_variable_defined?(:@nodes) or @nodes.nil?
      @nodes.unshift(node)
      self
    end
430531
Append append(String format, Object... args) {
    return append(String.format(format, args));
  }
1017539
def InsertArg(self, string='', **unused_kwargs):
    """"""
    logging.debug('Storing Argument {0:s}'.format(string))

    # This expression is complete
    if self.current_expression.AddArg(string):
      self.stack.append(self.current_expression)
      self.current_expression = self.expression_cls()
      return self.PopState()
    return None
658831
public static Object stringToParam(String string, String typeString) throws IllegalArgumentException {
		if (typeString.equals("boolean") || typeString.equals("java.lang.Boolean")) {
			return Boolean.parseBoolean(string);
		} else if (typeString.equals("char") || typeString.equals("java.lang.Character")) {
			if (string.length() == 0) {
				// not sure what to do here
				return '\0';
			} else {
				return string.toCharArray()[0];
			}
		} else if (typeString.equals("byte") || typeString.equals("java.lang.Byte")) {
			return Byte.parseByte(string);
		} else if (typeString.equals("short") || typeString.equals("java.lang.Short")) {
			return Short.parseShort(string);
		} else if (typeString.equals("int") || typeString.equals("java.lang.Integer")) {
			return Integer.parseInt(string);
		} else if (typeString.equals("long") || typeString.equals("java.lang.Long")) {
			return Long.parseLong(string);
		} else if (typeString.equals("java.lang.String")) {
			return string;
		} else if (typeString.equals("float") || typeString.equals("java.lang.Float")) {
			return Float.parseFloat(string);
		} else if (typeString.equals("double") || typeString.equals("java.lang.Double")) {
			return Double.parseDouble(string);
		} else {
			Constructor<?> constr = getConstructor(typeString);
			try {
				return constr.newInstance(new Object[] { string });
			} catch (Exception e) {
				throw new IllegalArgumentException(
						"Could not get new instance using string constructor for type " + typeString);
			}
		}
	}
779641
function append (value, string) {
  if (
    value === null || value === undefined || value === '' ||
    string === null || string === undefined
  ) {
    return value
  }
  return value + string
}
136854
public function prepend($data) {

		if(false === is_string($data)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
		}

		if(false !== $this -> file -> getExists()) {

			$this -> refresh();

    		if(false === $this -> file -> getWritable()) {
    			trigger_error(sprintf('File "%s" is not writable', $this -> file -> getBasepath()), E_USER_ERROR);
	    	}

    		$handle 	= fopen($this -> file -> getBasepath(), 'r+');
			$len 		= strlen($data);
			$final_len 	= filesize($this -> file -> getBasepath()) + $len;
			$cache_old 	= fread($handle, $len);
			
			rewind($handle);
			
			$i = 1;
			
			while(ftell($handle) < $final_len) {

				fwrite($handle, $data);
				
				$data 		= $cache_old;
				$cache_old 	= fread($handle, $len);

				fseek($handle, $i * $len);
				
				$i++;
			}
		}

		return $this;
	}
1095358
public String prepare(String input) {
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < input.length(); i++){
		    char c = input.charAt(i);        
		    if(map.get(c) != null) {
		    	replacements++;
		    	sb.append(map.get(c));
		    } else
		    	sb.append(c);
		}
		return sb.toString();
	}
843531
public function prepend($str)
    {
        $string = (string)$str;

        $string = $string . $this->text;

        return new MString($string);
    }
509943
public synchronized void prepend(String k, String v) {
        grow();
        for (int i = nkeys; i > 0; i--) {
            keys[i] = keys[i-1];
            values[i] = values[i-1];
        }
        keys[0] = k;
        values[0] = v;
        nkeys++;
    }
952111
final public StringWrapper prepare(String s) {
		BagOfTokens bag = new BagOfTokens(s, tokenizer.tokenize(s));
		double totalWeight = bag.getTotalWeight();
		for (Iterator i=bag.tokenIterator(); i.hasNext(); ) {
			Token tok = (Token)i.next();
			double freq = bag.getWeight(tok);
			bag.setWeight( tok, smoothedProbability(tok, freq, totalWeight) );
		}
		return bag;
	}
475920
public Element prependText(String text) {
        Validate.notNull(text);
        TextNode node = new TextNode(text);
        prependChild(node);
        return this;
    }
643280
function prependUntilLength (str, len, char) {
  if (str.length >= len) 
    return str
  else 
    return prependUntilLength(str=char+str, len, char)
}
1056656
def Prepend(self, **kw):
        
        kw = copy_non_reserved_keywords(kw)
        for key, val in kw.items():
            # It would be easier on the eyes to write this using
            # "continue" statements whenever we finish processing an item,
            # but Python 1.5.2 apparently doesn't let you use "continue"
            # within try:-except: blocks, so we have to nest our code.
            try:
                orig = self._dict[key]
            except KeyError:
                # No existing variable in the environment, so just set
                # it to the new value.
                self._dict[key] = val
            else:
                try:
                    # Check if the original looks like a dictionary.
                    # If it is, we can't just try adding the value because
                    # dictionaries don't have __add__() methods, and
                    # things like UserList will incorrectly coerce the
                    # original dict to a list (which we don't want).
                    update_dict = orig.update
                except AttributeError:
                    try:
                        # Most straightforward:  just try to add them
                        # together.  This will work in most cases, when the
                        # original and new values are of compatible types.
                        self._dict[key] = val + orig
                    except (KeyError, TypeError):
                        try:
                            # Check if the added value is a list.
                            add_to_val = val.append
                        except AttributeError:
                            # The added value isn't a list, but the
                            # original is (by process of elimination),
                            # so insert the the new value in the original
                            # (if there's one to insert).
                            if val:
                                orig.insert(0, val)
                        else:
                            # The added value is a list, so append
                            # the original to it (if there's a value
                            # to append).
                            if orig:
                                add_to_val(orig)
                            self._dict[key] = val
                else:
                    # The original looks like a dictionary, so update it
                    # based on what we think the value looks like.
                    if SCons.Util.is_List(val):
                        for v in val:
                            orig[v] = None
                    else:
                        try:
                            update_dict(val)
                        except (AttributeError, TypeError, ValueError):
                            if SCons.Util.is_Dict(val):
                                for k, v in val.items():
                                    orig[k] = v
                            else:
                                orig[val] = None
        self.scanner_map_delete(kw)
524634
public function appendF ($string)
	{
		ensure('Argument', $string, 'is_a_string', __CLASS__, __METHOD__);

		if ($string instanceof self) {
			$string = $string->to_s();
		}

		$this->string .= $string;

		return $this;
	}
815201
public static String arrayAsString(final String[] arg, String separator) {

        StringBuffer result = new StringBuffer();
        for (int i = 0; i < arg.length; i++) {
            result.append(arg[i]);
            if ((i + 1) < arg.length) {
                result.append(separator);
            }
        }
        return result.toString();
    }