def replaceAll(s, subs, rep):
    """
    Replaces all substrings in a string with another string
    """
    count = 0
    for i in s:
        if i == subs:
            count += 1
    return s.replace(subs, rep, count)