---
title: "How to split strings into tokens in Erlang?"  
description: "How to split strings into tokens in Erlang?"  
author: "Anonymous User"  
published: 2016-03-14  
updated: 2016-03-14  
canonical: https://www.mindstick.com/forum/34055/how-to-split-strings-into-tokens-in-erlang  
category: "erlang"  
tags: ["erlang"]  
reading_time: 1 minute  

---

# How to split strings into tokens in Erlang?

I am new in Erlang [programming](https://www.mindstick.com/articles/12214/web-development-company-in-india-laid-on-the-foundation-of-concrete-java-programming), so I want to know how can I [split](https://www.mindstick.com/blog/11920/top-3-voltas-split-acs-for-your-home) [strings](https://www.mindstick.com/forum/161912/explain-the-python-strings) using Erlang Code.This is my [String](https://www.mindstick.com/articles/1527/string-split-in-c-sharp): MyString = "I [Love](https://www.mindstick.com/articles/126121/love-is-money-money-is-love) Erlang Programming";I want to split above string into a list of tokens.\
Please help me, and give me an example if possible.Thank you.

## Replies

### Reply by Tarun Kumar

You can split string according to space existance, like this:*> MyTokens = string:tokens("I Love Erlang Programming", " ").*This will return a List of tokens like this:*["I","Love","Erlang","Programming"]*OR we can use any character to split string instead of space.\
Example: > *MyTokens = string:tokens("I.Love.Erlang.Programming", ".").*Result of above example will be same as the previous example.I hope it is sufficient to understand.


---

Original Source: https://www.mindstick.com/forum/34055/how-to-split-strings-into-tokens-in-erlang

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
