19 |
19 |
20 CharacterArray comment:' |
20 CharacterArray comment:' |
21 COPYRIGHT (c) 1994 by Claus Gittinger |
21 COPYRIGHT (c) 1994 by Claus Gittinger |
22 All Rights Reserved |
22 All Rights Reserved |
23 |
23 |
24 $Header: /cvs/stx/stx/libbasic/Attic/CharArray.st,v 1.16 1995-03-18 05:03:15 claus Exp $ |
24 $Header: /cvs/stx/stx/libbasic/Attic/CharArray.st,v 1.17 1995-04-11 14:48:32 claus Exp $ |
25 '! |
25 '! |
26 |
26 |
27 !CharacterArray class methodsFor:'documentation'! |
27 !CharacterArray class methodsFor:'documentation'! |
28 |
28 |
29 copyright |
29 copyright |
1268 !CharacterArray methodsFor:'padded copying'! |
1268 !CharacterArray methodsFor:'padded copying'! |
1269 |
1269 |
1270 paddedTo:newSize with:padCharacter |
1270 paddedTo:newSize with:padCharacter |
1271 "return a new string consisting of the receivers characters, |
1271 "return a new string consisting of the receivers characters, |
1272 plus pad characters up to length. |
1272 plus pad characters up to length. |
1273 If the receivers size is larger than the legth argument, it |
1273 If the receivers size is equal or greater than the length argument, |
1274 is returned unchanged." |
1274 the receiver is returned unchanged." |
1275 |
1275 |
1276 |s len| |
1276 |s len| |
1277 |
1277 |
1278 len := self size. |
1278 len := self size. |
1279 len < newSize ifTrue:[ |
1279 len < newSize ifTrue:[ |
1293 |
1293 |
1294 leftPaddedTo:size with:padCharacter |
1294 leftPaddedTo:size with:padCharacter |
1295 "return a new string of length size, which contains the receiver |
1295 "return a new string of length size, which contains the receiver |
1296 right-adjusted (i.e. padded on the left). |
1296 right-adjusted (i.e. padded on the left). |
1297 Characters on the left are filled with padCharacter. |
1297 Characters on the left are filled with padCharacter. |
1298 If the receivers size is larger than the legth argument, it |
1298 If the receivers size is equal or greater than the length argument, |
1299 is returned unchanged." |
1299 the receiver is returned unchanged." |
1300 |
1300 |
1301 |len s| |
1301 |len s| |
1302 |
1302 |
1303 len := self size. |
1303 len := self size. |
1304 (len < size) ifTrue:[ |
1304 (len < size) ifTrue:[ |
1321 !CharacterArray methodsFor:'copying'! |
1321 !CharacterArray methodsFor:'copying'! |
1322 |
1322 |
1323 concatenate:string1 and:string2 |
1323 concatenate:string1 and:string2 |
1324 "return the concatenation of myself and the arguments, string1 and string2. |
1324 "return the concatenation of myself and the arguments, string1 and string2. |
1325 This is equivalent to self , string1 , string2 |
1325 This is equivalent to self , string1 , string2 |
1326 - generated by compiler when such a construct is detected" |
1326 - generated by compiler when such a construct is detected and the receiver |
|
1327 is known to be a string." |
1327 |
1328 |
1328 ^ self , string1 , string2 |
1329 ^ self , string1 , string2 |
1329 ! |
1330 ! |
1330 |
1331 |
1331 concatenate:string1 and:string2 and:string3 |
1332 concatenate:string1 and:string2 and:string3 |
1332 "return the concatenation of myself and the string arguments. |
1333 "return the concatenation of myself and the string arguments. |
1333 This is equivalent to self , string1 , string2 , string3 |
1334 This is equivalent to self , string1 , string2 , string3 |
1334 - generated by compiler when such a construct is detected" |
1335 - generated by compiler when such a construct is detected and the receiver |
|
1336 is known to be a string." |
1335 |
1337 |
1336 ^ self , string1 , string2 , string3 |
1338 ^ self , string1 , string2 , string3 |
1337 ! ! |
1339 ! ! |
1338 |
1340 |
1339 !CharacterArray methodsFor:'filling and replacing'! |
1341 !CharacterArray methodsFor:'filling and replacing'! |