replaceing std::string with const char*
<p>I was wondering could someone please help me implemenrt this method whereas I dont need to use std::string.</p>

<p>The method takes in tewo parameters, one for char array and the other one is the size of the char array. </p>

<p>The parameters passed will be an array of differernt values seperated by commas, e.g. "Rule1,Rule2,Rule3,Rule4,AT,T,Cat,Dog".</p>

<p>The member variable "m_rulesSet" is a std::string constaining simular values. I want to compare the both to check if the "name" is within the std::string "m_ruleSet"</p>

<pre><code>bool 
Matche(const char *str, size_t strSize)
{
    std::string target(str, strSize);

    if(m_ruleSet.empty())
    {
        return true;
    }
    if((NULL == str) || (strSize &lt;= 0))
    {
        return false;
    }

    const char * ptr =0;
    const char * start = target.c_str();

    while ((ptr = strchr(start, ',')) != 0)
    {
        std::string name(start, ptr - start);
        if(name ==m_ruleSet)
        {
            return true;
        }
        start = ptr + 1;
    }
    if(*start)
    {
        std::string name(start);
        if(name==m_ruleSet)
        {
            return true;
        }
    }
    return false;
}
</code></pre>

<p>Please any help would be appreciated, thank you so much in advance</p>
