1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Python string: extract duplicated and randomly merged substring

Discussão em 'Python' iniciado por Stack, Setembro 13, 2024.

  1. Stack

    Stack Membro Participativo

    Example of duplicated and merged string:

    16.01068.0%0 8p%.a .p .a.


    Desired substring to be extracted:

    16.008% p.a.


    Fuller example:

    CCoonnttiinnggeenntt CCoouuppoonn 16.01068.0%0 8p%.a .p (.Ma.o (nMtholyn)thly)


    Desired substring:

    Contingent Coupon 16.008% p.a. (Monthly)


    My problem is when the original substring already has duplicate characters (like the two 0s in 16.008), my current function sometimes retains the wrong duplicate character (giving the incorrect result 16.080).

    Continue reading...

Compartilhe esta Página