Lines Matching refs:str
17 def bidi_detect(str: String): Boolean =
18 str.exists(c => c >= 0x590) && Bidi.requiresBidi(str.toArray, 0, str.length)
20 def bidi_override(str: String): String =
21 if (bidi_detect(str)) "\u200E\u202D" + str + "\u202C" else str
26 def lowercase(str: String): String = str.toLowerCase(Locale.ROOT)
27 def uppercase(str: String): String = str.toUpperCase(Locale.ROOT)
29 def capitalize(str: String): String =
30 if (str.length == 0) str
32 val n = Character.charCount(str.codePointAt(0))
33 uppercase(str.substring(0, n)) + lowercase(str.substring(n))
36 def perhaps_capitalize(str: String): String =
37 if (Codepoint.iterator(str).forall(c => Character.isLowerCase(c) || Character.isDigit(c)))
38 capitalize(str)
39 else str
48 def apply(c: Case, str: String): String =
50 case Lowercase => lowercase(str)
51 case Uppercase => uppercase(str)
52 case Capitalized => capitalize(str)
54 def unapply(str: String): Option[Case] =
55 if (str.nonEmpty) {
56 if (Codepoint.iterator(str).forall(Character.isLowerCase(_))) Some(Lowercase)
57 else if (Codepoint.iterator(str).forall(Character.isUpperCase(_))) Some(Uppercase)
59 val it = Codepoint.iterator(str)