The following code strips the spaces/tabs/newlines from given string using Python regex
We use '\S' in regex which stands for all non-whitespace characters
Example
import re print re.findall(r"[\S]","""I find Tutorialspoint useful""")
Output
This gives the output
['I', 'f', 'i', 'n', 'd', 'T', 'u', 't', 'o', 'r', 'i', 'a', 'l', 's', 'p', 'o', 'i', 'n', 't', 'u', 's', 'e', 'f', 'u', 'l']