Category talk:Wren-str: Difference between revisions

Bug fixed properly now!
(Bug fix)
(Bug fixed properly now!)
Line 800:
 
// Converts a UTF-8 string to upper case.
// Automatically uses title case for the first character if it's one of 4 supported digraphs.
static upper(s) {
if (!(s is String)) s = "%(s)"
Line 825 ⟶ 824:
c == 0x01A1 || c == 0x01B0 || c == 0x01F5) {
chars[i] = String.fromCodePoint(c - 1)
} else if ((i == 0) && (c == 0x01C40x01C5 || c == 0x01C70x01C8 || c == 0x01CA0x01CB || c == 0x01F1)0x01F2) {
chars[i] = String.fromCodePoint(c + 1)
} else if ((i > 0) && (c == 0x01C5 || c == 0x01C8 || c == 0x01CB || c == 0x01F2)) {
chars[i] = String.fromCodePoint(c - 1)
} else if (c == 0x01C6 || c == 0x01C9 || c == 0x01CC || c == 0x01F3) {
chars[i] = String.fromCodePoint((i > 0) ? c - 2 : c - 1)
} else if ((c >= 0x01DF && c <= 0x01EF) && (c % 2 == 1)) {
chars[i] = String.fromCodePoint(c - 1)
Line 876 ⟶ 873:
 
// Capitalizes the first character of a UTF-8 string.
// Automatically usesUses title caserather forthan theupper firstcase charactervariant if it's one of 4 supported digraphs.
static capitalize(s) {
if (!(s is String)) s = "%(s)"
Line 881 ⟶ 879:
var start = (s.startsWith("[") && s.count > 1) ? 1 : 0
var cs = upper(s[start])
var c = cs.codePoints[0]
} else if ((i > 0) && (c == 0x01C50x01C4 || c == 0x01C80x01C7 || c == 0x01CB0x01CA || c == 0x01F2)0x01F1) {
chars[i]cs = String.fromCodePoint(c + 1)
}
if (s.count > start + 1) cs = cs + s[start+1..-1]
if (start == 1) cs = "[" + cs
Line 887 ⟶ 889:
 
// Capitalizes the first character of each word of a UTF-8 string.
// Uses title rather than upper case variant if it's one of 4 supported digraphs.
static title(s) {
if (!(s is String)) s = "%(s)"
9,476

edits