split method
Leave feedback
On this page
Splits the input string into individual words.
def split(self, text):
...
| Parameter | Type | Description |
|---|---|---|
| text | str |
The input text to be split. |
Returns: Iterable[str]: An enumeration of words extracted from the input text.
class WhiteSpaceWordSplitter:
def split(self, text):
return text.split()
splitter = WhiteSpaceWordSplitter()
words = splitter.split("Hello world")
print(list(words)) # ['Hello', 'world']
```
### Aliases
These names call `split` too, limited to the overloads listed.
| Alias | Accepts |
| :- | :- |
| `split_file` | `split_file(text)` |
| `split_string` | `split_string(text)` |
### See Also
* class [`IWordSplitter`](/search/python-net/groupdocs.search.common/iwordsplitter/)
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.