本文整理汇总了C#中System.Char.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Char.Equals方法的具体用法?C# Char.Equals怎么用?C# Char.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Char
的用法示例。
在下文中一共展示了Char.Equals方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: isDigit
/// <summary><c>isDigit</c>
/// Checks the given char if it's a digit.</summary>
/// <param name="val">Any char</param>
/// <returns type="char">is char digit ('0'-'9')</returns>
private bool isDigit(Char val)
{
return val.Equals('1') || val.Equals('2') ||
val.Equals('3') || val.Equals('4') ||
val.Equals('5') || val.Equals('6') ||
val.Equals('7') || val.Equals('8') ||
val.Equals('9') || val.Equals('0');
}
示例2: IsOperator
private Boolean IsOperator(Char expression)
{
return expression.Equals(Convert.ToChar(ADD)) ||
expression.Equals(Convert.ToChar(SUBTRACT)) ||
expression.Equals(Convert.ToChar(MULTIPLY)) ||
expression.Equals(Convert.ToChar(DIVIDE)) ||
expression.Equals(Convert.ToChar(MODULUS)) ||
expression.Equals(Convert.ToChar(EXPONENT)) ||
expression.Equals(Convert.ToChar(DICEROll));
}
示例3: IsValidRatingChar
protected Boolean IsValidRatingChar(Char c)
{
return Char.IsDigit(c) || c.Equals('.');
}
示例4: IsElementStart
private Boolean IsElementStart(Char c)
{
return c.Equals('<');
}
示例5: isVariable
/// <summary><c>isVariable</c>
/// Checks the given char if it's a variable. x | y | z
/// <param name="val">Any char</param>
/// <returns type="char">is char x|y|z</returns></summary>
private bool isVariable(Char val)
{
return val.Equals('x') || val.Equals('y') || val.Equals('z');
}
示例6: isTerm
/// <summary><c>isTerm</c>
/// Checks the given char is '*' or '/'
/// <param name="val">Any char</param>
/// <returns type="bool">is char '*' or '/'</returns></summary>
private bool isTerm(Char val)
{
return val.Equals('*') || val.Equals('/');
}
示例7: isExp
/// <summary><c>isExp</c>
/// Checks the given char is '+' or '-'
/// <param name="val">Any char</param>
/// <returns type="bool">is char '+' or '-'</returns></summary>
private bool isExp(Char val)
{
return val.Equals('+') || val.Equals('-');
}