Is Safe char - CSharp System

CSharp examples for System:Char

Description

Is Safe char

Demo Code


using System.Text.RegularExpressions;
using System.Text;
using System.Collections.Generic;
using System;//  ww w.  jav a2s .com

public class Main{
        #region UrlEncode
        internal static bool IsSafe(char ch)
        {
            if ((((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z'))) || ((ch >= '0') && (ch <= '9')))
            {
                return true;
            }
            switch (ch)
            {
                case '\'':
                case '(':
                case ')':
                case '*':
                case '-':
                case '.':
                case '_':
                case '!':
                    return true;
            }
            return false;
        }
}

Related Tutorials