简体   繁体   English

Haskell-返回的字符数,不包括标点和空格

[英]Haskell - Return number of chars excluding punctuation and spaces

I've just learned how to count the number of chars in a string using length nameoflist and I'm wondering if it's possible to count the number of chars without spaces/punctuation? 我刚刚学习了如何使用length nameoflist来计算字符串中的字符数,并且我想知道是否可以计算没有空格/标点的字符数?

Any help is appreciated,thanks 任何帮助表示赞赏,谢谢

import Data.Char

length $ filter isAlphaNum nameoflist

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM