From 638d3e849458d6faa1f5813a4617c7ca3ec40e79 Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 17 Nov 2024 14:51:55 -0500 Subject: [PATCH] cwText.h/cpp : Added firstMatchChar(char*,int,char) form of first char. match function. --- cwText.cpp | 15 +++++++++++++++ cwText.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/cwText.cpp b/cwText.cpp index 811a8de..c40bad2 100644 --- a/cwText.cpp +++ b/cwText.cpp @@ -158,6 +158,21 @@ char* cw::firstMatchChar( char* s, char c ) } const char* cw::firstMatchChar( const char* s, char c ) +{ return firstMatchChar((char*)s,c); } + +char* cw::firstMatchChar( char* s, unsigned n, char c ) +{ + if( s == nullptr ) + return nullptr; + + for(unsigned i=0; *s && i