[Python] Python split() function :: Need to split "int_32\n' " so that I get int_32 alone

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

  1. Stack

    Stack Membro Participativo

    Need to split "int_32\n' " so that I get int_32 alone.

    I tried

    x = "int_32\n' "
    x.split("\n")


    I also tried

    x = "int_32\n' "
    x.splitlines()


    Both do not yield the required output which is int_32

    Instead it yields int_32\n'

    \n is what is creating an issue. Anyway I can do this?

    Continue reading...

Compartilhe esta Página