comment/format in:7 methods
authorClaus Gittinger <cg@exept.de>
Sat, 20 Oct 2012 21:11:08 +0200
changeset 14405 1d0d99a95bba
parent 14404 49a54ea47bf8
child 14406 1974e60efafb
comment/format in:7 methods
CharacterArray.st
--- a/CharacterArray.st	Sat Oct 20 15:35:36 2012 +0200
+++ b/CharacterArray.st	Sat Oct 20 21:11:08 2012 +0200
@@ -868,6 +868,8 @@
 !
 
 asWideString
+    "return a two-byte string containing the same characters as the receiver"
+
     ^ self asTwoByteString
 
     "
@@ -876,6 +878,8 @@
 !
 
 capitalized
+    "same as asUppercaseFirst for Squeak compatibility"
+
     ^ self asUppercaseFirst
 
     "
@@ -892,15 +896,17 @@
 !
 
 charactersExactlyMatching:aString
+    "return the number of characters I share as a prefix with the argument, aString"
+
     |idx nMax|
 
     nMax :=(self size) min:(aString size).
     idx := 1.
     [idx <= nMax] whileTrue:[
-	(self at:idx) = (aString at:idx) ifFalse:[
-	    ^ idx - 1
-	].
-	idx := idx + 1.
+        (self at:idx) = (aString at:idx) ifFalse:[
+            ^ idx - 1
+        ].
+        idx := idx + 1.
     ].
     ^ nMax
 
@@ -1012,6 +1018,8 @@
 !
 
 lastSpacePosition
+    "return the index of the last space character; 0 if there is none"
+
     ^ self lastIndexOfSeparator
 !
 
@@ -1553,6 +1561,7 @@
 ! !
 
 
+
 !CharacterArray methodsFor:'character searching'!
 
 includesMatchCharacters
@@ -3711,6 +3720,11 @@
 
 encodeFrom:oldEncoding into:newEncoding
     ^ CharacterEncoder encodeString:self from:oldEncoding into:newEncoding
+
+    "
+     'δόφ' encodeFrom:#iso8859 into:#utf8
+     ('δόφ' encodeFrom:#iso8859 into:#utf8) encodeFrom:#utf8 into:#unicode
+    "
 !
 
 rot13
@@ -4642,6 +4656,9 @@
 !
 
 hasChangeOfEmphasis
+    "return true, if the receiver contains non-empty emphasis information
+     i.e. any non-normal (=emphasized) characters"
+
     ^ false
 
     "Created: 12.5.1996 / 12:31:39 / cg"
@@ -4979,7 +4996,9 @@
 !
 
 firstLine
-    ^ self asCollectionOfSubCollectionsSeparatedBy:Character cr do:[:line | ^ line].
+    "return the first line of a multiline string"
+
+    ^ self asCollectionOfSubCollectionsSeparatedBy:(Character cr) do:[:line | ^ line].
 
     "
      'hello' firstLine
@@ -6080,11 +6099,11 @@
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.475 2012-07-10 07:39:54 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.476 2012-10-20 19:11:08 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.475 2012-07-10 07:39:54 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.476 2012-10-20 19:11:08 cg Exp $'
 ! !
 
 CharacterArray initialize!