substring #2

  • Follow


Is there a function in C that can tell me whether one string exists in 
another string?

i.e. returns 0 is the word "hello" is in the string "ajkhfyeajhk 
hellojklajljdsfas," or something like that...
0
Reply skazahay (8) 4/26/2006 2:00:40 AM

sk wrote:
> Is there a function in C that can tell me whether one string exists in 
> another string?
> 
> i.e. returns 0 is the word "hello" is in the string "ajkhfyeajhk 
> hellojklajljdsfas," or something like that...

Have a look at strstr() in string.h.
-None
0
Reply none7 (273) 4/26/2006 2:13:02 AM


sk <skazahay@purdue.edu> writes:

> Is there a function in C that can tell me whether one string exists in 
> another string?

strstr()
-- 
"Am I missing something?"
--Dan Pop
0
Reply blp (3953) 4/26/2006 2:18:47 AM

sk wrote:
> Is there a function in C that can tell me whether one string exists in 
> another string?
> 
> i.e. returns 0 is the word "hello" is in the string "ajkhfyeajhk 
> hellojklajljdsfas," or something like that...

Thank you both! Sorry if it was a dumb question, I'm still trying to 
find my way around C. Thank you again!
0
Reply skazahay (8) 4/26/2006 2:22:25 AM

3 Replies
35 Views

(page loaded in 0.087 seconds)

Similiar Articles:













7/26/2012 6:43:39 AM


Reply: