Board index » delphi » help- searching strings

help- searching strings

Does anyone know how to search a string for another string in it... like
if i searched the string "hellotherebob" for the word "the".  How would
I do that.  I am trying to use the strscan(s1,s2); but i am also using
ddplus and ddplus won't let me read in S1 because S1 is an array of
char.  I keep getting a type mismatch.

--

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|  ----  |                 |                                |
|  |     |                 |  /                             |
|  |     |___  |   | ____  |/         hel...@nji.com        |
|  |___  |  |  |___| |___  |  \                             |
|                                                           |
| http://blackbear.nji.com/~helmet                          |
| http://www.csam.montclair.edu/~cameron/chuck/chuck.html   |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

 

Re:help- searching strings


Try POS (substring,fullstring);

It will give you an integer value with the starting character of the
substring in the full string.  If the substring isn't there it returns a zero.

Ken

In article <318A1D21.6...@blackbear.nji.com>, hel...@blackbear.nji.com says...

Quote

>Does anyone know how to search a string for another string in it... like
>if i searched the string "hellotherebob" for the word "the".  How would
>I do that.  I am trying to use the strscan(s1,s2); but i am also using
>ddplus and ddplus won't let me read in S1 because S1 is an array of
>char.  I keep getting a type mismatch.

>--

>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>|  ----  |                 |                                |
>|  |     |                 |  /                             |
>|  |     |___  |   | ____  |/         hel...@nji.com        |
>|  |___  |  |  |___| |___  |  \                             |
>|                                                           |
>| http://blackbear.nji.com/~helmet                          |
>| http://www.csam.montclair.edu/~cameron/chuck/chuck.html   |
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
Views expressed herein are not necessarily the views
of Ontrack Computer Systems, Inc. or Ontrack Data Recovery, Inc.
*******************************************************************
* Ken Stieers               |  Minneapolis - 1.800.872.2599       *
* AV Research/Apps. Eng.    |  Los Angeles - 1.800.752.7557       *
* Ontrack Computer Systems  |  Washington, D.C. - 1.800.650.2410  *
* Ontrack Data Recovery     |  London - 0800 24 39 96             *
* Eden Prairie, MN          |  Japan - 81.429.32-6365             *
*******************************************************************

Other Threads