fork(1) download
  1. splitQ :: String -> [String]
  2. splitQ s = unko id id s where
  3. unko c1 c2 [] = c2 $ c1' : []
  4. where c1' = c1 []
  5. unko c1 c2 (x:xs)
  6. | x == '?' = unko id (c2 . (c1 [] :)) xs
  7. | otherwise = unko (c1 . (x :)) c2 xs
  8.  
  9. main = print $ splitQ "213?46464?698"
Success #stdin #stdout 0s 4692KB
stdin
Standard input is empty
stdout
["213","46464","698"]