# Split String with Delimiter

We can split a string with delimiter(s) using `re` (Regular Expression) module.

### Example

```python
>>> import re
>>> text = "These are collections of words seperated by a space."
>>> print(re.split(" ", text))
['These', 'are', 'collections', 'of', 'words', 'seperated', 'by', 'a', 'space.']
```

Here, we're splitting the string `text` using `" "` (space) delimiter.

Also, for customs delimiters we can do something like -

```python
re.split(" |\n")
```

***Source:*** [***W3Resource***](https://www.w3resource.com/python-exercises/re/python-re-exercise-47.php)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.devjugal.com/python/split-string-with-delimiter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
