What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-10-26 14:21:12
stristr php
#Case-insensitive strstr() #stristr(string $haystack, string $needle, bool $before_needle = false): string|false #Returns all of haystack starting from and including the first occurrence of needle to the end. <?php $email = '[email protected]'; ech... Add solution -
C 2021-10-20 21:57:03
C count occurrences of a substring
#include <stdio.h> #include <string.h> int count(const char *str, const char *sub) { int sublen = strlen(sub); if (sublen == 0) return 0; int res = 0; for (str = strstr(str, sub); str; str = strstr(str + sublen, sub)) ... Add solution -
C++ 2021-10-06 21:18:05
use of strstr in c++
#include <iostream> #include <string.h> using namespace std; int main() { char str1[] = "Apples are red"; char str2[] = "are"; char *ptr; ptr = strstr(str1, str2);  ... Add solution