[erlang-questions] splitting string into to substring

Yunita C l1nk2306@REDACTED
Thu Sep 11 00:19:07 CEST 2008


Hi All,





I am new to erlang and I want to write Erlang function that given a
string and a pattern and uses the pattern to split the string into like
this: 




For example if the pattern is "ab" and the string is "acabcabts" the code will return ["ac", "cabts"]. 





If the pattern is "bc" and the string is "bcad" the code returns ["", ad]. 





If the pattern is "ac" and the string is "bcad" the code will return ["bcad", ""]. 





I'm trying to make function using  list but still stuck there. Can anybody help me? Thank's so much.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080910/47d12ada/attachment.htm>


More information about the erlang-questions mailing list