def _prepend_append_replace(word,
                            prepend='',
                            append='',
                            replace='',
                            replacement=''):
    """Prepends, appends and replaces text in a word.
    Args:
        word: A string literal to prepend, append or replace on.
        prepend: A string literal to prepend to word.
        append: A string literal to append to word.
        replace: A string literal that repersents a substring in word to be
          replaced.
        replacement: A string literal. In word, all occurances of replace will
          be changed to replacement.
    Returns:
        A string after appending, prepending and replacing to word.
    """
    if replace:
        word = word.replace(replace, replacement)
    if prepend:
        word = prepend + word
    if append:
        word = word + append
    return word