src/String.cc

changeset 89
029a330a9bef
parent 88
5def6ff8b466
child 115
9be16e1c1e44
equal deleted inserted replaced
88:5def6ff8b466 89:029a330a9bef
57 for (int i = 0; i < copy.Length(); ++i) 57 for (int i = 0; i < copy.Length(); ++i)
58 if (copy[i] == c) 58 if (copy[i] == c)
59 copy.RemoveAt (i); 59 copy.RemoveAt (i);
60 60
61 /* 61 /*
62 while(( pos = copy.first( c )) != -1 ) 62 int pos = 0;
63 copy.erase( pos ); 63 while ((pos = copy.First (c)) != -1)
64 copy.RemoveAt (pos--);
64 */ 65 */
65 66
66 return copy; 67 return copy;
67 } 68 }
68 69
70 // 71 //
71 String String::ToUppercase() const 72 String String::ToUppercase() const
72 { 73 {
73 String newstr = mString; 74 String newstr = mString;
74 75
75 for (char & c : newstr) 76 for (char& c : newstr)
76 if (c >= 'a' && c <= 'z') 77 if (c >= 'a' && c <= 'z')
77 c -= 'a' - 'A'; 78 c -= 'a' - 'A';
78 79
79 return newstr; 80 return newstr;
80 } 81 }

mercurial