The str.split()
method without an argument splits on whitespace:
>>> "many fancy word \nhello \thi".split() ['many', 'fancy', 'word', 'hello', 'hi']
Related Posts:
- How can I exclude one word with grep?
- How can I split and parse a string in Python?
- Python regex AttributeError: ‘NoneType’ object has no attribute ‘group’
- python re.split() to split by spaces, commas, and periods, but not in cases like 1,000 or 1.50
- python re.split() to split by spaces, commas, and periods, but not in cases like 1,000 or 1.50
- Split a string into 2 in Python
- Split string with multiple delimiters in Python [duplicate]
- How to find all occurrences of a substring?
- Python string.replace regular expression
- Remove all special characters, punctuation and spaces from string
- This can be done without regex:
- Python string.replace regular expression
- Grep and Python
- How to replace ” \ ” with ” \\ ” in java
- Regex how to match an optional character
- What does regular expression \\s*,\\s* do?
- How can I remove punctuation from input text in Java?
- Remove all special characters, punctuation and spaces from string
- How can I remove punctuation from input text in Java?
- What is the grep equivalent in Python?
- Python re.split() vs split()
- AttributeError: ‘list’ object has no attribute ‘lower’ gensim
- How to ignore whitespace in a regular expression subject string?
- python regular expression “\1”
- Regular expression – starting and ending with a character string
- Using strip() to clean up a string
- Regex empty string or email
- How do I lowercase a string in Python?
- OR condition in Regex
- Using or ‘|’ in regex [duplicate]
- How do I get a substring of a string in Python?
- Does Python have a string ‘contains’ substring method?
- How does strtok() split the string into tokens in C?
- Convert bytes to a string
- Replacing instances of a character in a string
- Changing one character in a string
- How to read a file line-by-line into a list?
- strip(char) on a string
- How to convert list to string [duplicate]
- TypeError: a bytes-like object is required, not ‘str’ when writing to a file in Python3
- Converting integer to string in Python
- Reverse a string in Python
- How to split a string in Java
- What is a Context Free Grammar?
- python .replace() regex [duplicate]
- How do I compare two strings in python?
- Regex not operator
- working of \n in python [duplicate]
- ValueError: could not convert string to float: id
- What does \’.- mean in a Regular Expression
- Regex not operator
- Print string to text file
- Best way to convert string to bytes in Python 3?
- Pythonic way to create a long multi-line string
- Best way to convert string to bytes in Python 3?
- Does Python have a string ‘contains’ substring method?
- TypeError: not all arguments converted during string formatting python
- Javascript split regex question
- How can I validate an email address using a regular expression?
- Regular expression to match a line that doesn’t contain a word
- Regex not operator
- ‘str’ object does not support item assignment
- How do I append one string to another in Python?
- Java split string to array [duplicate]
- Difference between \b and \B in regex
- How do I append one string to another in Python?
- Random string generation with upper case letters and digits
- Regex: ignore case sensitivity
- What does the regex \S mean in JavaScript?
- Split string into array
- whitespace in regular expression
- How can I validate an email address using a regular expression?
- Regex: ignore case sensitivity
- Regular Expression for alphanumeric and underscores
- How to read a text file into a string variable and strip newlines?
- What is the difference between the regular expressions [^\d\s] and [\D\S]
- Convert bytes to a string
- Split a string using C++11
- How to print like printf in Python3?
- string to string array conversion in java
- Regex: AttributeError: ‘NoneType’ object has no attribute ‘groups’
- Regular Expression for alphanumeric and underscores
- re.sub erroring with “Expected string or bytes-like object”
- How to read a text file into a string variable and strip newlines?
- grep –ignore-case –only
- How do I iterate over the words of a string?
- Regex AND operator
- Regex to test if string begins with http:// or https://
- Regular expression negative lookahead
- Python convert tuple to string
- Regex how to match an optional character
- How do I iterate over the words of a string?
- write() versus writelines() and concatenated strings
- Regular Expression to match string starting with a specific word
- Why is it string.join(list) instead of list.join(string)?
- Why is it string.join(list) instead of list.join(string)?
- Regular Expressions: Is there an AND operator?
- How to remove punctuation in python?
- Writing a very simple lexical analyser in C++
- How to split a String by space