Created
April 25, 2013 16:43
-
-
Save veer66/5461215 to your computer and use it in GitHub Desktop.
Haskell มันไม่มี substr ใน standard library จริงหรือ เกรงว่าผมจะหาไม่เจอเอง แต่โปรแกรมนี้ทำงานถูกก็ใช้การได้แล้ว
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
substr :: [Char] -> Int -> Int -> [Char] | |
substr str start end = | |
let length' = end - start | |
in (take length' (drop start str)) | |
main = do | |
x <- readFile "u8.txt" | |
putStrLn (substr x 3 8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment