title: C#- Check if a string has only the allowed character in it?
body: <p>Lets say I have some string like below</p>
  <pre><code>string x=&quot;Demo&quot;;
  string x1=&quot;Demo/Abc&quot;;
  </code></pre>
  <p>So,my string may or may not contain  '/'.</p>
  <p>So I want to create a method that accepts the string and returns false if it contains any special characters except '/'.</p>
  <pre><code>bool res= CheckCharacter(string input); 
  </code></pre>
  <p>How to do this using c#?</p>