moved pad methods to superclass.
authorClaus Gittinger <cg@exept.de>
Wed, 29 Dec 1999 12:26:18 +0100
changeset 5154 2143a3af5072
parent 5153 dc159974af2b
child 5155 d6e0aca50f36
moved pad methods to superclass.
CharacterArray.st
--- a/CharacterArray.st	Wed Dec 29 12:23:46 1999 +0100
+++ b/CharacterArray.st	Wed Dec 29 12:26:18 1999 +0100
@@ -3943,33 +3943,6 @@
     "
 !
 
-leftPaddedTo:size with:padCharacter
-    "return a new string of length size, which contains the receiver
-     right-adjusted (i.e. padded on the left).
-     Characters on the left are filled with padCharacter.
-     If the receivers size is equal or greater than the length argument, 
-     the original receiver is returned unchanged."
-
-    |len s|
-
-    len := self size.
-    (len < size) ifTrue:[
-	s := self species new:size withAll:padCharacter.
-	s replaceFrom:(size - len + 1) with:self.
-	^ s
-    ]
-
-    "
-     'foo' leftPaddedTo:10 with:$.      
-     'fooBar' leftPaddedTo:5 with:$.      
-     123 printString leftPaddedTo:10 with:$.        
-     (' ' , 123 printString) leftPaddedTo:10 with:$.        
-     (Float pi printString) leftPaddedTo:15 with:(Character space)  
-     (Float pi printString) leftPaddedTo:15 with:$-           
-     (' ' , Float pi class name) leftPaddedTo:15 with:$.     
-    "
-!
-
 paddedTo:newSize
      "return a new string consisting of the receivers characters,
      plus spaces up to length.
@@ -3982,30 +3955,6 @@
      'foo' paddedTo:10            
      123 printString paddedTo:10 
     "
-!
-
-paddedTo:newSize with:padCharacter
-    "return a new string consisting of the receivers characters,
-     plus pad characters up to length.
-     If the receivers size is equal or greater than the length argument, 
-     the  original receiver is returned unchanged."
-
-    |s len|
-
-    len := self size.
-    len < newSize ifTrue:[
-	s := self species new:newSize withAll:padCharacter.
-	s replaceFrom:1 to:len with:self.
-	^ s
-    ]
-
-    "
-     'foo' paddedTo:10 with:$.             
-     123 printString paddedTo:10 with:$*   
-     (Float pi printString) paddedTo:15 with:(Character space)  
-     (Float pi printString) paddedTo:15 with:$-  
-     (Float pi class name , ' ') paddedTo:15 with:$.  
-    "
 ! !
 
 !CharacterArray methodsFor:'pattern matching'!
@@ -4393,6 +4342,7 @@
     "Modified: 17.4.1997 / 12:50:23 / cg"
 ! !
 
+
 !CharacterArray methodsFor:'special string converting'!
 
 chopTo:maxLen
@@ -5520,6 +5470,6 @@
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.174 1999-12-20 10:56:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.175 1999-12-29 11:26:18 cg Exp $'
 ! !
 CharacterArray initialize!