- In python, we have different functions which remove the spaces between the strings.
- There are three functions that remove the whitespace between the strings, they are:
- strip(), rstrip(), lstrip() are the three functions having the same meaning but some differences.
lstrip(): It removes the whitespace at beginning of the string.
rstrip(): It removes the whitespace at end of the string.
Example: write a python to demonstrate the remove space function.
- txt=" hello"