Why isn't my or statement working, C++?
<p>I'm trying to create a function that will replace 0's, 1's, or 2's with spaces in a string. I'm going about it by iterating through the string and comparing each individual character. </p>

<p>My function will work if I compare <strong>str_in[i] == '0'</strong>, but if I add the or statement it returns nothing. </p>

<p>Snippet:</p>

<pre><code>string omit_num( string ) {
    int i ;

    str_len = str_in.length();
    str_out = "" ; 

    for( i = 0 ; i &lt; str_len ; i ++ ){
         cout &lt;&lt; str_in[i] &lt;&lt; endl; 
         if ( str_in[i] == '0' || '1' || '2') 
            app = " " ;
         else
             app = str_in[i];
         str_out.append(app) ; 
    }
    return str_out; 

}
</code></pre>
