[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to count the number of occurrences of a character in a string?
From: |
Brendan Halpin |
Subject: |
Re: How to count the number of occurrences of a character in a string? |
Date: |
Tue, 13 Oct 2015 21:46:26 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
On Tue, Oct 13 2015, Eli Zaretskii wrote:
> Also, did you actually try 'mapc', per my second suggestion?
Why not mapcar?
(defun test (str char)
(apply '+ (mapcar (lambda (x) (if (= x char) 1 0))
str)))
B
--
Brendan Halpin, Head, Department of Sociology, University of Limerick, Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F1-002 x 3147
mailto:brendan.halpin@ul.ie ULSociology on Facebook: http://on.fb.me/fjIK9t
http://teaching.sociology.ul.ie/bhalpin/wordpress twitter:@ULSociology
- Re: How to count the number of occurrences of a character in a string?, (continued)
- Re: How to count the number of occurrences of a character in a string?, Stefan Monnier, 2015/10/12
- Re: How to count the number of occurrences of a character in a string?, Kaushal Modi, 2015/10/13
- Re: How to count the number of occurrences of a character in a string?, Kaushal Modi, 2015/10/15
- Re: How to count the number of occurrences of a character in a string?, Eli Zaretskii, 2015/10/15
- Re: How to count the number of occurrences of a character in a string?, Eli Zaretskii, 2015/10/13
- Re: How to count the number of occurrences of a character in a string?, Kaushal Modi, 2015/10/15
- Re: How to count the number of occurrences of a character in a string?, Eli Zaretskii, 2015/10/13
- Re: How to count the number of occurrences of a character in a string?, Kaushal Modi, 2015/10/13
- Re: How to count the number of occurrences of a character in a string?, Eli Zaretskii, 2015/10/13
- Re: How to count the number of occurrences of a character in a string?, Kaushal Modi, 2015/10/13
- Message not available
- Re: How to count the number of occurrences of a character in a string?,
Brendan Halpin <=
- Re: How to count the number of occurrences of a character in a string?, Kaushal Modi, 2015/10/13
- Message not available
- Re: How to count the number of occurrences of a character in a string?, Joost Kremers, 2015/10/13
- Re: How to count the number of occurrences of a character in a string?, Oleh Krehel, 2015/10/14
- Re: How to count the number of occurrences of a character in a string?, Eli Zaretskii, 2015/10/14
- Re: How to count the number of occurrences of a character in a string?, Michael Heerdegen, 2015/10/13
- Re: How to count the number of occurrences of a character in a string?, Charles Curley, 2015/10/15
- Re: How to count the number of occurrences of a character in a string?, Noam Postavsky, 2015/10/15
- Re: How to count the number of occurrences of a character in a string?, Kaushal Modi, 2015/10/14
Re: How to count the number of occurrences of a character in a string?, Emanuel Berg, 2015/10/13
Re: How to count the number of occurrences of a character in a string?, Joost Kremers, 2015/10/12