def strip_consecutive_repeated_char(s, ch):
    """Strip characters in a string which are consecutively repeated.

    Useful when in notes or some other free text fields on Mambu, users
    capture anything and a lot of capture errors not always detected by
    Mambu get through. You want some cleaning? this may be useful.

    This is a string processing function.
    """
    sdest = ""
    for i,c in enumerate(s):
        if i != 0 and s[i] == ch and s[i] == s[i-1]:
            continue
        sdest += s[i]
    return sdest
def strip_consecutive_repeated_char ( s , ch ) : sdest = "" for i , c in enumerate ( s ) : if i != 0 and s [ i ] == ch and s [ i ] == s [ i - 1 ] : continue sdest += s [ i ] return sdest
Strip characters in a string which are consecutively repeated.

    Useful when in notes or some other free text fields on Mambu, users
    capture anything and a lot of capture errors not always detected by
    Mambu get through. You want some cleaning? this may be useful.

    This is a string processing function.