How to split strings into tokens in Erlang?

Total Post:128


 1524  View(s)
Rate this:
I am new in Erlang programming, so I want to know how can I split strings using Erlang Code.
This is my String: MyString = "I 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.
  1. Re: How to split strings into tokens in Erlang?

    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:
    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.

      Modified On Apr-11-2018 02:10:47 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.