Skip to content

Commit

Permalink
Updated comments with improved executable examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
JP-WWU committed Oct 24, 2019
1 parent 55974c3 commit 5766339
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Collections-Strings/String.class.st
Expand Up @@ -469,13 +469,13 @@ String >> >= aString [
{ #category : #comparing }
String >> alike: aString [
"Answer some indication of how alike the receiver is to the argument, 0 is no match, twice aString size is best score (but see example with 7). Case is ignored. This method is used to help find mistyped variable names in methods."
"('abc' alike: 'abc') >>> 7.
('abc' alike: '1') >>> 0.
('abc' alike: 'ABC') >>> 7.
('abc' alike: 'ab') >>> 3.
('abc' alike: 'bbb') >>> 1.
('abc' alike: 'xyz') >>> 1."
"Answer some indication of how alike the receiver is to the argument, 0 is no match, twice aString size is best score (but see example with 7). Case is ignored. This method is used to help find mistyped variable names in methods.
('abc' alike: 'abc') >>> 7.
('action' alike: 'actions') >>> 7.
('action' alike: 'caption') >>> 5.
('action' alike: 'name') >>> 0.
"
| i j k minSize bonus |
minSize := (j := self size) min: (k := aString size).
Expand Down

0 comments on commit 5766339

Please sign in to comment.