Checks if letter is space ' ' or any punctuation (. , : ; ' " ! ?) - CSharp System

CSharp examples for System:String Parse

Description

Checks if letter is space ' ' or any punctuation (. , : ; ' " ! ?)

Demo Code


using System.Text;
using System.Globalization;
using System.Collections.Specialized;
using System.Collections;
using System;// w ww .  j a  v a2  s  .  c o  m

public class Main{
        /// <summary>
        /// Checks if letter is space ' ' or any punctuation (. , : ; ' " ! ?)
        /// </summary>
        public static bool IsSpaceOrPunctuation( char letter )
        {
            return
                letter == ' ' ||
                letter == '.' ||
                letter == ',' ||
                letter == ':' ||
                letter == ';' ||
                letter == '\'' ||
                letter == '\"' ||
                letter == '!' ||
                letter == '?' ||
                letter == '*';
        } // IsSpaceOrPunctuation(letter)
}

Related Tutorials