Function Details: strip

Description

Returns a copy of the string with leading and trailing characters removed.

Original string: " Hello World! " " H e l l o W o r l d ! " After strip(): "Hello World!" " H e l l o W o r l d ! " Whitespace removed by strip()

This is first explanation

Extended Description

The strip() method returns a copy of the string with leading and trailing characters removed. If the chars argument is not provided, it removes leading and trailing whitespace characters (space, tab, newline, return, formfeed).


Read More about strip from Python Documentation

Function Signature



Module: builtins

Class: str

Parameters



Parameter List


  • chars: str

Return



Return Type


str

Output

Explanation