I found this archived on the mailing list to add the missing
findString: startingAt: method ala VisualWorks :
CharacterArray extend [
findString: subString startingAt: start [
<category: 'VisualWorks compatibility'>
"Answer the index of subString within the receiver, starting at
start.
If no such match is found, answer 0. "
^self indexOfSubCollection: subString startingAt: start
]
]
When I try to use it as in this example :
Transcript show: (cwd findString: 'export' startingAt: 1).
(assuming my cwd is something like /export/home/foo/bar)
GST emits the following message and hangs..
Object: 2
Any ideas why this isn't working? I just want to be
able to find the index of a substring so I can chop
a path down when I'm looking for a specific path
component within a path (e.g. in the example below,
I'd be looking for "directory" in the path and
return everything to the left of the "directory"
path string)
From:
/a/path/to/my/long/directory/is/here
To:
/a/path/to/my/long/directory
Thx!
_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk