I've thought of this.
Code: Select all
switch (ch) {
case 'a':
//My code...
break;
case 'b':
//My code...
break;
//And so on...
}
Advertising
Code: Select all
switch (ch) {
case 'a':
//My code...
break;
case 'b':
//My code...
break;
//And so on...
}
Code: Select all
if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'))
{
// Your code
}
Code: Select all
Match match = Regex.Match(ch, @"[a-z]", RegexOptions.IgnoreCase);
if (match.Success)
{
// Your code
}
Well, I'm not 100% sure since I've never used C#, but most likely yes since almost all languages allow that (specially C and C++ in which syntax C# is inspired).Nickolas wrote:so I can use '<' and '>' with letters?
It's an external library, and yes it is: http://sourceforge.net/projects/deveel-regex/Nickolas wrote:I don't want to use the regex method because I don't know if it has been implemented in Mono
Nickolas wrote:is there an easier way to write this?