char sub[] = "world";
char str[] = "Hello world and hello World!";
count-substring sub in str to define num_occ
pf-out "Found %lld occurrences!\n", num_occ
count-substring sub in str to num_occ case-insensitive
pf-out "Found %lld occurrences!\n", num_occ
You are free to copy, redistribute and adapt this web page (even commercially), as long as you give credit and provide a dofollow link back to this page - see full license at
CC-BY-4.0. Copyright (c) 2019-2023 Dasoftver LLC. Vely and elephant logo are trademarks of Dasoftver LLC. The software and information on this web site are provided "AS IS" and without any warranties or guarantees of any kind. Icons from
table-icons.io copyright Paweł Kuna, licensed under
MIT license.