What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » searching some letters or words in sentence...

searching some letters or words in sentence...
Author: Message:
mezzanine
Full Member
***

Avatar

Posts: 106
Reputation: 23
– / – / Flag
Joined: May 2005
Status: Away
RE: searching some letters or words in sentence...
This C code snippet will attempt to find the first occurence of needle in haystack. For reference, the strstr function returns a pointer to the first occurence of needle in haystack, or NULL if the needle is not found.

code:
#include <stdio.h>
#include <string.h>

main() {
char haystack[] = "This is our sentence";
char needle[] = "se";
if (strstr(haystack, needle)) printf("Found needle in haystack.");
    else printf("Not found.");
}


09-19-2006 05:09 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
searching some letters or words in sentence... - by genesistr on 09-19-2006 at 04:28 PM
RE: searching some letters or words in sentence... - by mezzanine on 09-19-2006 at 05:09 PM
RE: searching some letters or words in sentence... - by Silentdragon on 09-19-2006 at 05:16 PM
RE: searching some letters or words in sentence... - by genesistr on 09-19-2006 at 07:10 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On