Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
character Comparison
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rainer Joswig  
View profile  
 More options Feb 20 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Rainer Joswig <rainer.jos...@ision.de>
Date: 2000/02/20
Subject: Re: character Comparison
In article <mZLr4.9509$_e7.372...@news1.sshe1.sk.home.com>, "Chris H"

<newsgroupNOJ...@NOJUNKhome.com> wrote:
> Hi all,
> I am a newbie in lisp programming ...

Make sure you have a Common Lisp reference handy.
The ANSI CL standard is available in a hypertextified
version. Another source of wisdom is CLtL2 (Common Lisp
the Language, 2nd edition) - also available as hypertext.
For more information about Lisp visit http://www.lisp.org .

> and
> I have a question on doing character comparison
> eg

> how do I check if  character 'a' is in word 'banada'

> is any thing like substring() function ?

  FIND item sequence &key :from-end :test :test-not :start
  :end :key
  [Function]
  returns the first element in the specified portion of sequence that
  matches item according to test, or nil if no element matches.

? (find #\a "BANANA" :test #'char=)
NIL

Rainer Joswig, ISION Internet AG, Harburger Schlossstraße 1,
21079 Hamburg, Germany, Tel: +49 40 77175 226
Email: rainer.jos...@ision.de , WWW: http://www.ision.de/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Feb 20 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 2000/02/20
Subject: Re: character Comparison
* "Chris H" <newsgroupNOJ...@NOJUNKhome.com>
| how do I check if  character 'a' is in word 'banada'
|
| is any thing like substring() function ?

  yes.  FIND, POSITION, SEARCH, CHAR, SUBSEQ, etc.

  note that most operations on characters and strings in Common Lisp are
  simply special cases of operations on elements and sequences.  many
  C-based programmers are frustrated because they think that Common Lisp
  has few string-handling functions.  Common Lisp has few string-only
  functions, so remember to look for sequence and array functions, too.

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erann Gat  
View profile  
 More options Feb 22 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: g...@jpl.nasa.gov (Erann Gat)
Date: 2000/02/22
Subject: Re: character Comparison

In article <3160029562363...@naggum.no>, Erik Naggum <e...@naggum.no> wrote:
> * "Chris H" <newsgroupNOJ...@NOJUNKhome.com>
> | how do I check if  character 'a' is in word 'banada'
> |
> | is any thing like substring() function ?

>   yes.  FIND, POSITION, SEARCH, CHAR, SUBSEQ, etc.

>   note that most operations on characters and strings in Common Lisp are
>   simply special cases of operations on elements and sequences.  many
>   C-based programmers are frustrated because they think that Common Lisp
>   has few string-handling functions.  Common Lisp has few string-only
>   functions, so remember to look for sequence and array functions, too.

As long as we're on the subject, what is the best way to iterate over
a string/sequence?  (map nil ... s)?  (dotimes (i (length s)) ...
(char s i) ...)?

E.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »