@@ -218,6 +218,14 @@ replaced.`)
218218 return self .(String ).LStrip (args )
219219 }, 0 , "lstrip(chars) -> replace chars from begining of string" )
220220
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+
221229}
222230
223231// Type of this object
@@ -739,6 +747,14 @@ func (s String) RStrip(args Tuple) (Object, error) {
739747 return String (strings .TrimRightFunc (string (s ), f )), nil
740748}
741749
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+
742758// Check stringerface is satisfied
743759var (
744760 _ richComparison = String ("" )
0 commit comments