added #includesSubstring:caseSensitive:
authorClaus Gittinger <cg@exept.de>
Mon, 19 Jul 1999 19:32:35 +0200
changeset 4409 86e049b21f8d
parent 4408 3d76920644f6
child 4410 2bdc0c89a42e
added #includesSubstring:caseSensitive:
CharArray.st
CharacterArray.st
--- a/CharArray.st	Mon Jul 19 18:35:37 1999 +0200
+++ b/CharArray.st	Mon Jul 19 19:32:35 1999 +0200
@@ -2243,6 +2243,28 @@
     "Modified: / 18.6.1998 / 16:04:46 / cg"
 ! !
 
+!CharacterArray methodsFor:'Compatibility - Squeak'!
+
+includesSubstring:aString caseSensitive:caseSensitive
+    "return true, if a substring is contained in the receiver.
+     The argument, caseSensitive controls if case is ignored in the compare."
+
+    "/ for now,  a q&d hack ...
+
+    caseSensitive ifFalse:[
+        ^ self asLowercase includesString:aString asLowercase
+    ].
+    ^ self includesString:aString
+
+    "
+     'hello world' includesSubstring:'Hel' caseSensitive:true  
+     'hello world' includesSubstring:'Hel' caseSensitive:false 
+    "
+
+
+
+! !
+
 !CharacterArray methodsFor:'Compatibility - V''Age'!
 
 addLineDelimiter
@@ -5329,6 +5351,6 @@
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/CharArray.st,v 1.162 1999-07-15 13:34:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/CharArray.st,v 1.163 1999-07-19 17:32:35 cg Exp $'
 ! !
 CharacterArray initialize!
--- a/CharacterArray.st	Mon Jul 19 18:35:37 1999 +0200
+++ b/CharacterArray.st	Mon Jul 19 19:32:35 1999 +0200
@@ -2243,6 +2243,28 @@
     "Modified: / 18.6.1998 / 16:04:46 / cg"
 ! !
 
+!CharacterArray methodsFor:'Compatibility - Squeak'!
+
+includesSubstring:aString caseSensitive:caseSensitive
+    "return true, if a substring is contained in the receiver.
+     The argument, caseSensitive controls if case is ignored in the compare."
+
+    "/ for now,  a q&d hack ...
+
+    caseSensitive ifFalse:[
+        ^ self asLowercase includesString:aString asLowercase
+    ].
+    ^ self includesString:aString
+
+    "
+     'hello world' includesSubstring:'Hel' caseSensitive:true  
+     'hello world' includesSubstring:'Hel' caseSensitive:false 
+    "
+
+
+
+! !
+
 !CharacterArray methodsFor:'Compatibility - V''Age'!
 
 addLineDelimiter
@@ -5329,6 +5351,6 @@
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.162 1999-07-15 13:34:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.163 1999-07-19 17:32:35 cg Exp $'
 ! !
 CharacterArray initialize!