aboutsummaryrefslogtreecommitdiff
path: root/src/base/string/find.c
blob: 821094d0c07d01b5f91c9881bcfc7b272360e7fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "internal.h"

// find will find the first occurence of
// substr in the string returns -1 if nothing was found.
int
string·find(string s, char* substr)
{
    char* loc = str·find(s, substr);

    if(loc == nil)
        return -1;
    return(int)(loc - s);
}