2007-05-29
■ [Chapter5] Data types: tuples and lists (6日目) 
Exercise 5.9
リスト中の小文字を大文字に変換する関数 capitalize を定義する。
import Data.Char
capitalize :: String -> String
capitalize xs = [ toUpper c | c <- xs, isAscii c ]
次に、文字列中の小文字を大文字に変換した上で、文字以外をリストから除去する関数 capitalizeLetters を定義する。
import Data.Char
capitalizeLetters :: String -> String
capitalizeLetters xs = [ toUpper c | c <- xs, isLower c ]
Mircea2012/01/06 22:44I was looking everywhere and this ppoepd up like nothing!
nqbfdm2012/01/07 18:56CDqKKp <a href="http://uysxqhvdkgud.com/">uysxqhvdkgud</a>
cqclheylm2012/01/08 19:18c7WVHI , [url=http://zafyulgdrtio.com/]zafyulgdrtio[/url], [link=http://qnhocwckhvkp.com/]qnhocwckhvkp[/link], http://ozexughzcaak.com/
qgooroyzrkk2012/01/09 22:581OnwAh <a href="http://jtftxjxvvglq.com/">jtftxjxvvglq</a>
ouupiqcp2012/01/11 03:53fFxN5D , [url=http://mukiviomzbdz.com/]mukiviomzbdz[/url], [link=http://obwugpdzrkls.com/]obwugpdzrkls[/link], http://rieihcmtassa.com/