@@ -218,6 +218,14 @@ replaced.`)
218
218
return self .(String ).LStrip (args )
219
219
}, 0 , "lstrip(chars) -> replace chars from begining of string" )
220
220
221
+ StringType .Dict ["upper" ] = MustNewMethod ("upper" , func (self Object , args Tuple , kwargs StringDict ) (Object , error ) {
222
+ return self .(String ).Upper ()
223
+ }, 0 , "upper() -> a copy of the string converted to uppercase" )
224
+
225
+ StringType .Dict ["lower" ] = MustNewMethod ("lower" , func (self Object , args Tuple , kwargs StringDict ) (Object , error ) {
226
+ return self .(String ).Lower ()
227
+ }, 0 , "lower() -> a copy of the string converted to lowercase" )
228
+
221
229
}
222
230
223
231
// Type of this object
@@ -739,6 +747,14 @@ func (s String) RStrip(args Tuple) (Object, error) {
739
747
return String (strings .TrimRightFunc (string (s ), f )), nil
740
748
}
741
749
750
+ func (s String ) Upper () (Object , error ) {
751
+ return String (strings .ToUpper (string (s ))), nil
752
+ }
753
+
754
+ func (s String ) Lower () (Object , error ) {
755
+ return String (strings .ToLower (string (s ))), nil
756
+ }
757
+
742
758
// Check stringerface is satisfied
743
759
var (
744
760
_ richComparison = String ("" )
0 commit comments