Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Task2_2 where
- import Data.Char (isSpace)
- mySubstring xs m n = take n $ drop m xs
- myTrim = dropWhile isSpace . reverse . dropWhile isSpace . reverse
- split "" _ = []
- --split xs x = foldr f [""]
- --splitBy :: Char -> String -> [String]
- --splitBy _ "" = [];
- --splitBy delimiterChar inputString = foldr f [""] inputString
- -- where f :: Char -> [String] -> [String]
- -- f currentChar allStrings@(partialString:handledStrings)
- -- | currentChar == delimiterChar = "":allStrings -- start a new partial string at the head of the list of all strings
- -- | otherwise = (currentChar:partialString):handledStrings -- add the current char to the partial string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement