About 31,700,000 results
Open links in new tab
  1. string - How to cut a line in python? - Stack Overflow

    Apr 8, 2014 · Use either csv or just to straight file io with string split function. For example: reader = csv.reader(f) for row in reader: print row[:9] or if everything is on a single line and you don't …

  2. Python strip() – How to Trim a String or Line - freeCodeCamp.org

    Jan 12, 2022 · In this article, you'll learn how to trim a string in Python using the .strip() method. You'll also see how to use the .lstrip() and .rstrip() methods, which are the counterparts to …

  3. Break a long line into multiple lines in Python - GeeksforGeeks

    Aug 31, 2022 · Break a long line into multiple lines using the string concatenation operator. The string concatenation operator (+), something so basic, can easily replace backslashes in the …

  4. Cutting and Slicing Strings in Python

    Python provides string methods that allows us to chop a string up according to delimiters that we can specify. In other words, we can tell Python to look for a certain substring within our target …

  5. How to Trim a String in Python: Three Different Methods

    Feb 16, 2025 · In this tutorial, I will walk you through the three primary methods for trimming strings in Python: .strip(), .lstrip(), and .rstrip(), and I will cover specific use cases to …

  6. String Slicing in Python - GeeksforGeeks

    Apr 9, 2025 · String slicing in Python is a way to get specific parts of a string by using start, end and step values. It’s especially useful for text manipulation and data parsing. Let’s take a quick …

  7. How to cut a string in Python? - Stack Overflow

    Nov 23, 2011 · string = 'http://www.domain.com/?s=some&two=20' cut_string = string.split('&') new_string = cut_string[0] print(new_string)

  8. string - Cut specific line of a text python - Stack Overflow

    Jul 10, 2018 · How can I cut specific text from a python file (around 150 000 000 lines)? I mean that program has to find one word and ending word and cut it what is between these lines. I …

  9. How to Skip a Line in Python? [4 Ways] - Python Guides

    Feb 5, 2024 · One of the simplest ways to skip a line in Python is by using the pass statement, which acts as a placeholder. It allows you to bypass a code line without causing any Python …

  10. Python Trim Using strip (), rstrip () and lstrip ()

    Feb 20, 2020 · There are three functions available in Python Programming to do Python trim of string. These are strip(), lstrip() and rstrip().

  11. Some results have been removed
Refresh