Re: string search?



Bertram Trabant said:

Hello, Im working on a little LAN game in the style of old text-only
MUD's and would need to find a way to search for a string in a text
file (for example for usernames). I know it works in the way of looking
for the first letter, if matches the second and so on, but don't know
how to write it. Any suggestions?

Look up "Boyer-Moore" or "Knuth-Morris-Pratt".

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.



Relevant Pages

  • Re: string search?
    ... Bertram Trabant wrote: ... file (for example for usernames). ... for the first letter, if matches the second and so on, but don't know ... If you are going to be doing a fair amount of string manipulation in C for this project then I suggest you do one of two things: ...
    (comp.lang.c)
  • Re: string search?
    ... file (for example for usernames). ... for the first letter, if matches the second and so on, but don't know ... Search directly in the file using stdio functions like fopen, ... string and search the string. ...
    (comp.lang.c)
  • Re: UserName Property
    ... dim UName as String ... UName = LCase) ... I am having problems with two of the usernames. ... For multiple authorized users, use code like ...
    (microsoft.public.excel.programming)
  • Re: string search?
    ... MUD's and would need to find a way to search for a string in a text ... file (for example for usernames). ... Andrew Poelstra ... use 'apoelstra' at the above site. ...
    (comp.lang.c)
  • Re: string search?
    ... Andreas Kochenburger wrote: ... MUD's and would need to find a way to search for a string in a text ... file (for example for usernames). ... Why would you deliberately introduce non-portable elements when they ...
    (comp.lang.c)