aboutsummaryrefslogtreecommitdiff
path: root/djb/str_chr.c
diff options
context:
space:
mode:
Diffstat (limited to 'djb/str_chr.c')
-rw-r--r--djb/str_chr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/djb/str_chr.c b/djb/str_chr.c
new file mode 100644
index 0000000..1506f30
--- /dev/null
+++ b/djb/str_chr.c
@@ -0,0 +1,6 @@
+unsigned int str_chr(const char *in, char needle) /*EXTRACT_INCL*/ {
+ unsigned int u=0;
+ char ch;
+ while ((ch=in[u]) && ch != needle) u++;
+ return u;
+}