带有示例的 Scala Char isTitleCase() 方法
isTitleCase()方法用于查找所述字符是否为标题大小写字符。如果由字符 .getType(ch) 生成的一般类别类型是 TITLECASE_LETTER,则该字符称为标题大小写字符。
Method Definition: def isTitleCase: Boolean
Return Type: It returns true if the stated character is Title-Case else it returns false.
示例:1#
// Scala program of isTitleCase()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isTitleCase() method
val result = '\u01f2'.isTitleCase
// Displays output
println(result)
}
}
输出:
true
示例:2#
// Scala program of isTitleCase()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isTitleCase() method
val result = ('T').isTitleCase
// Displays output
println(result)
}
}
输出:
false