About 261,000 results
Open links in new tab
  1. string - strip () vs lstrip () vs rstrip () in Python - Stack Overflow

    lstrip, rstrip and strip remove characters from the left, right and both ends of a string respectively. By default they remove whitespace characters (space, tabs, linebreaks, etc)

  2. python - What does s.strip () do exactly? - Stack Overflow

    Dec 9, 2012 · Additionally, there is a very powerful tool within the Python interactive interpreter - you can do something like help("".strip) to get a bevy of useful information.

  3. String.strip() in Python - Stack Overflow

    Without strip (), you can have empty keys and values: apples<tab>round, fruity things oranges<tab>round, fruity things bananas<tab> Without strip (), bananas is present in the …

  4. python - Why doesn't .strip () remove whitespaces? - Stack Overflow

    The large majority of the questions I answer, I do so using SO! Maybe SO should make available a JFGI flag for noobs? Ha! Anyway, thanks for the explanation, appreciate it. strip doesn't …

  5. Python strip with \n - Stack Overflow

    Feb 19, 2012 · 37 The strip() method removes whitespace by default, so there is no need to call it with parameters like '\t' or '\n'. However, strings in Python are immutable and can't be modified, …

  6. python - How to use text strip () function? - Stack Overflow

    Please do not ask questions that are easily addressed by reading the docs. You are expected to have done some research, and looking at documentation for some method you don't …

  7. python - How do I trim whitespace? - Stack Overflow

    Is there a Python function that will trim whitespace (spaces and tabs) from a string? So that given input &quot; \\t example string\\t &quot; becomes &quot;example string&quot;.

  8. python - How can I remove a trailing newline? - Stack Overflow

    An example in Python's documentation simply uses line.strip(). Perl's chomp function removes one linebreak sequence from the end of a string only if it's actually there.

  9. list - how to use strip () in python - Stack Overflow

    Oct 8, 2015 · 3 Pointers: strip returns a new string, so you need to assign that to something. (better yet, just use a list comprehension) Iterating over a file object gives you lines, not words; …

  10. Python strip method - Stack Overflow

    Feb 1, 2013 · You are misunderstanding what .strip() does. It removes any of the characters found in the string you pass. From the str.strip() documentation: The chars argument is a …