#DOCUMENTATION by cg
authorClaus Gittinger <cg@exept.de>
Wed, 29 May 2019 10:11:12 +0200
changeset 24232 506ee6a81f82
parent 24231 640ee6d97772
child 24233 9db9068aed81
#DOCUMENTATION by cg class: CharacterArray added: #caselessAfter: #caselessBefore: #caselessEqual: comment/format in: #compareCaselessWith:
CharacterArray.st
--- a/CharacterArray.st	Wed May 29 03:27:42 2019 +0000
+++ b/CharacterArray.st	Wed May 29 10:11:12 2019 +0200
@@ -371,7 +371,6 @@
     "Modified: / 16-01-2018 / 18:59:04 / stefan"
 ! !
 
-
 !CharacterArray class methodsFor:'cleanup'!
 
 lowSpaceCleanup
@@ -634,7 +633,6 @@
     "
 ! !
 
-
 !CharacterArray class methodsFor:'pattern matching'!
 
 matchEscapeCharacter
@@ -1042,7 +1040,6 @@
     ^ Unicode32String
 ! !
 
-
 !CharacterArray class methodsFor:'utilities'!
 
 through:aCharacter in:inStream 
@@ -2375,6 +2372,48 @@
     "Modified (comment): / 29-06-2018 / 11:41:33 / Claus Gittinger"
 !
 
+caselessAfter:aString
+    "True if the receiver comes after aString, if compared caseless.
+     (i.e. if receiver > aString, ignoring case)"
+
+    ^ (self compareCaselessWith:aString) > 0
+
+    "
+     'aaa1' > 'aaA2' -> true
+     'aaa1' caselessAfter: 'aaA2' -> false
+    "
+
+    "Created: / 29-05-2019 / 10:09:55 / Claus Gittinger"
+!
+
+caselessBefore:aString
+    "True if the receiver comes before aString, if compared caseless.
+     (i.e. if receiver < aString, ignoring case)"
+
+    ^ (self compareCaselessWith:aString) < 0
+
+    "
+     'aaa1' < 'aaA2' -> false
+     'aaa1' caselessBefore: 'aaA2' -> true
+    "
+
+    "Created: / 29-05-2019 / 10:09:18 / Claus Gittinger"
+!
+
+caselessEqual:aString
+    "True if the receiver has the same characters as aString, if compared caseless.
+     (i.e. if receiver = aString, ignoring case)"
+
+    ^ (self sameAs:aString)
+
+    "
+     'aaa1' = 'aaA1' -> false
+     'aaa1' caselessEqual: 'aaA1' -> true
+    "
+
+    "Created: / 29-05-2019 / 10:10:53 / Claus Gittinger"
+!
+
 compareAsVersionNumberWith:aStringOrCollection
     "Compare the receiver with the argument and return 1 if the receiver is
      greater, 0 if equal and -1 if less than the argument in a sorted list.
@@ -2437,8 +2476,14 @@
     mySize < otherSize ifTrue:[^ -1].
     ^ 0
 
+    "
+     'aaa1' < 'aaA2' -> false
+     'aaa1' compareCaselessWith: 'aaA2' -> -1
+    "
+
     "Modified: / 22-04-1996 / 15:56:07 / cg"
     "Modified (comment): / 26-10-2017 / 16:01:01 / mawalch"
+    "Modified (comment): / 29-05-2019 / 10:06:00 / Claus Gittinger"
 !
 
 compareCollatingWith:aString
@@ -5311,8 +5356,6 @@
 ! !
 
 
-
-
 !CharacterArray methodsFor:'matching - glob expressions'!
 
 compoundMatch:aString
@@ -6120,7 +6163,6 @@
 ! !
 
 
-
 !CharacterArray methodsFor:'padded copying'!
 
 centerPaddedTo:newSize
@@ -7280,7 +7322,6 @@
     "Modified: 17.4.1997 / 12:50:23 / cg"
 ! !
 
-
 !CharacterArray methodsFor:'special string converting'!
 
 asUnixFilenameString
@@ -8654,7 +8695,6 @@
     "
 ! !
 
-
 !CharacterArray methodsFor:'substring searching'!
 
 findRangeOfString:subString
@@ -9239,7 +9279,6 @@
     ^ aVisitor visitString:self with:aParameter
 ! !
 
-
 !CharacterArray class methodsFor:'documentation'!
 
 version