String manipulation 
Author Message
 String manipulation

Hi, I'm new to LISP and I have a question I suspect stems from my C-eish
ways!  I have a string
"A + (B+C)*(A'+D)"
I need to be able to have that tokenized.  I want the first level to
include the two elements "A" and "(B+C)*(A'+D)".  And then I want to
split the second string from the the middle multiplication sign etc... I
thought I can achieve this by searching for the "+" and "*", but I
haven't been able to find a string-search function in common-lisp
(something like strstr in C, I think).
Is there such a function that can search strings and give me indexes
based on character positions?  I know that strings are just arrays, but
I couldn't find an array function that will let me access all BUT the
first element (ie I could build my own string manipulation routines).
Any pointers/suggestions would be greatly appreciated!
Thanks,
Michael Abd-El-Malek


Tue, 16 Apr 2002 03:00:00 GMT  
 String manipulation
* Michael Abd-El-Malek
| Is there such a function that can search strings and give me indexes
| based on character positions?

  see the functions SEARCH, FIND, POSITION.  they operate on sequences,
  which forms the supertype of list, vector, array, and string.  you won't
  find all that many functions specific to strings in Common Lisp, because
  most of the time, they're useful to all sorts of sequences.  this also
  means you use SUBSEQ to extract substrings, and COPY-SEQ to copy strings.

#:Erik



Tue, 16 Apr 2002 03:00:00 GMT  
 String manipulation
Thanks, I now have a lot of experimenting to do with all the tips I've
received!
The LISP community gives great support so far :)
Michael
Quote:

> * Michael Abd-El-Malek
> | Is there such a function that can search strings and give me indexes
> | based on character positions?

>   see the functions SEARCH, FIND, POSITION.  they operate on sequences,
>   which forms the supertype of list, vector, array, and string.  you won't
>   find all that many functions specific to strings in Common Lisp, because
>   most of the time, they're useful to all sorts of sequences.  this also
>   means you use SUBSEQ to extract substrings, and COPY-SEQ to copy strings.

> #:Erik



Tue, 16 Apr 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. string manipulations

2. Question: String manipulation

3. String manipulation

4. String Manipulation with awk

5. String Manipulation

6. String Manipulation

7. How to do string manipulation in Eiffel?

8. String Manipulation in Forth

9. String Manipulation and Pulldown men

10. String Manipulation and Pulldown menu libraries for Forth

11. String Manipulation Routines

12. string manipulation

 

 
Powered by phpBB® Forum Software