Sign InSign Up

Rocketbot Forum

Rocketbot Forum Logo Rocketbot Forum Logo

Rocketbot Forum Navigation

  • Academy Rocketbot
  • Tutorials
  • Documentación
Search
Ask A Question

Mobile menu

Close
  • Home
  • Popular
  • Categories
  • Tags
  • Questions
    • New Questions
    • Most voted
    • Most visited
    • Most Responded
  • Academy Rocketbot
  • Tutorials
  • Documentación
Home/ Questions/Q 3926
Next
Answered

Rocketbot Forum Latest Questions

alebogado
  • 0
  • 0
alebogado
Asked: July 27, 20212021-07-27T19:32:35+00:00 2021-07-27T19:32:35+00:00In: Comandos

eliminar salto de linea string

  • 0
  • 0

Hola, Una consulta alguien sabe como puedo eliminar un salto de linea con python me esta dando error.

intente de la siguiente forma:

«{variable}».replace(‘/n’,»)

y «{variable}».rstrip(‘\n’)

eliminar saltos de linea
2
  • 2 2 Answers
  • 11k Views
  • 0 Followers
  • 0
Share
  • Facebook

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. Bender
      Best Answer
      Bender
      2021-07-27T21:16:13+00:00Added an answer on July 27, 2021 at 9:16 pm

      Hola alebogado,

      Como la variable que quieres modificar tiene saltos de línea, debes pasarla entre 3 comillas dobles.
      Para reemplazar el salto de línea es de esta forma:
      """{variable}""".replace("\n","")

       

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
      • alebogado
        alebogado
        2021-07-28T12:17:42+00:00Replied to answer on July 28, 2021 at 12:17 pm

        Funciono perfecto, Gracias. Saludos

          • 0
        • Reply
        • Share
          Share
          • Share on Facebook
          • Share on Twitter
          • Share on LinkedIn
          • Share on WhatsApp

    Leave an answer
    Cancel reply

    You must login to add an answer.


    Forgot Password?

    Need An Account, Sign Up Here

    Sidebar

    Ask A Question

    Stats

    • Questions : 1k
    • Answers : 2k
    • Posts : 0
    • Comments : 0
    • Best Answers : 163
    • Users : 5k
    • Popular
    • Comments
    • Tags

    Related Questions

      • Answers: 0

      Eld.gg Path of Exile 2 Currency: Looting in multiplayer

      • Answers: 0

      Obtener URL actual PDF en nueva pestaña

      • Answers: 0

      Obtener URL actual PDF en nueva pestaña

      • Answers: 3

      Problema con typing_extensions al usar EasyOCR en RocketBot

      • Answer: 1

      Error al importar una libreria python

    Users

    Explore

    • Home
    • Popular
    • Categories
    • Tags
    • Questions
      • New Questions
      • Most voted
      • Most visited
      • Most Responded

    Footer

    rocketbot white

    Rocketbot SpA | Todos los derechos reservados 2018 - 2020

    © 2020 Discy. All Rights Reserved
    With Love by 2code.

    en_US
    es_ES en_US

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.