[Python] Python: Create strikethrough / strikeout / overstrike string type

Discussão em 'Python' iniciado por Stack, Fevereiro 10, 2025.

  1. Stack

    Stack Membro Participativo

    I would appreciate some help in creating a function that iterates through a string and combines each character with a strikethrough character (\u0336). With the output being a striked out version of the original string. Like this..

    Something like.

    def strike(text):
    i = 0
    new_text = ''
    while i < len(text):
    new_text = new_text + (text + u'\u0336')
    i = i + 1
    return(new_text)


    So far I've only been able to concatenate rather than combine.

    Continue reading...

Compartilhe esta Página