Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Collections-Strings/String.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,10 @@ String >> expandMacrosWithArguments: anArray [
{ #category : 'finding/searching' }
String >> findAnySubstring: aCollection startingAt: start [
"Answer the index where an element of aCollection begins. If none are found, answer size + 1. aCollection is an Array of Strings or Characters."
"'abcdef' findAnySubstring: 'cde' startingAt: 1 >>> 3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put parentheses because >>> is a binary message so it is executed prior to findAny..:

"'Ana voli Milovana' findAnySubstring: #('Ana' 'ana') startingAt: 2 >>> 15"
"'Ana voli Milovana' findAnySubstring: #('Ana' 'ana') startingAt: 1 >>> 1"
"'Marcus' findAnySubstring: 'o' startingAt: 1 >>> 7"

^aCollection inject: 1 + self size into: [:min :searchTerm |
| ind |
Expand Down