lib/mystring/find_first_ch.cc
changeset 0 6f7a81934006
equal deleted inserted replaced
-1:000000000000 0:6f7a81934006
       
     1 #include "mystring.h"
       
     2 #include <string.h>
       
     3 
       
     4 int mystring::find_first(char ch, size_t offset) const
       
     5 {
       
     6   if(offset >= rep->length)
       
     7     return -1;
       
     8   char* ptr = strchr(rep->buf+offset, ch);
       
     9   return ptr ? ptr-rep->buf : -1;
       
    10 }
       
    11