The problem I am trying to solve looks like this, take an address string:
"Street, City, State"
and split it into ["Street", "City", "State"]
, in order to do this I am trying to use elemIndex
like:
elemIndex "," "a, b, c"
but I realize that this violates the type signature of
elemIndex :: String -> List String -> Maybe Int
and tried a variation with characters because [Char]
and String
are the same type.
elemIndex ',' "a, b, c"
but that results in a type error as well. Which function is appropriate to do this if elemIndex
is not appropriate to solve this problem.