Substrings for strings?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Substrings for strings?

Nathan Tuttle
I can't find any method that allows me to take a substring out of a string my location and length.

Anyone know?

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Substrings for strings?

Eliot Miranda-2


2010/2/19 Nathan Tuttle <[hidden email]>
I can't find any method that allows me to take a substring out of a string my location and length.

Hint: look in SequenceableCollection.
 

Anyone know?

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Substrings for strings?

Peter Hugosson-Miller
In reply to this post by Nathan Tuttle
location := 5.
length := 3.
result := 'Foo Bar Baz' copyFrom: location to: position + length - 1



2010/2/20 Nathan Tuttle <[hidden email]>
I can't find any method that allows me to take a substring out of a string my location and length.

Anyone know?

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



--
Cheers,
Peter

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Substrings for strings?

Nathan Tuttle
Thank you very much!

2010/2/19 Peter Hugosson-Miller <[hidden email]>
location := 5.
length := 3.
result := 'Foo Bar Baz' copyFrom: location to: position + length - 1



2010/2/20 Nathan Tuttle <[hidden email]>
I can't find any method that allows me to take a substring out of a string my location and length.

Anyone know?

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



--
Cheers,
Peter

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Substrings for strings?

Peter Hugosson-Miller
On 20 feb 2010, at 02.44, Nathan Tuttle <[hidden email]> wrote:

Thank you very much!

...says he, generously ignoring my copy/paste error.

Seriously, when will I learn not to post untested code in an email, no matter how trivial it seems at the time? Still, at least I spelled the method name correctly :-p.

--
Cheers,
Peter

2010/2/19 Peter Hugosson-Miller <[hidden email]>
location := 5.
length := 3.
result := 'Foo Bar Baz' copyFrom: location to: position + length - 1



2010/2/20 Nathan Tuttle <[hidden email]>
I can't find any method that allows me to take a substring out of a string my location and length.

Anyone know?

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



--
Cheers,
Peter

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Substrings for strings?

Nathan Tuttle
but it worked! and it helped me I didn't have to override strings!

2010/2/19 Peter Hugosson-Miller <[hidden email]>
On 20 feb 2010, at 02.44, Nathan Tuttle <[hidden email]> wrote:

Thank you very much!

...says he, generously ignoring my copy/paste error.

Seriously, when will I learn not to post untested code in an email, no matter how trivial it seems at the time? Still, at least I spelled the method name correctly :-p.

--
Cheers,
Peter

2010/2/19 Peter Hugosson-Miller <[hidden email][hidden email]>
location := 5.
length := 3.
result := 'Foo Bar Baz' copyFrom: location to: position + length - 1



2010/2/20 Nathan Tuttle <[hidden email][hidden email]>
I can't find any method that allows me to take a substring out of a string my location and length.

Anyone know?

_______________________________________________
Pharo-project mailing list
[hidden email][hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



--
Cheers,
Peter

_______________________________________________
Pharo-project mailing list
[hidden email][hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Substrings for strings?

Stéphane Ducasse
In reply to this post by Nathan Tuttle
the meta approach

did you try the methodfinder?

open method finder

type

        'Foo Bar Baz' . 5 . 3

-> no single function

        'Foo Bar Baz' . $B . 'Bar'
-> no single function

I stopped but often I find what I want.


On Feb 20, 2010, at 1:05 AM, Nathan Tuttle wrote:

> I can't find any method that allows me to take a substring out of a string my location and length.
>
> Anyone know?
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Substrings for strings?

Nathan Tuttle
Often; I don't. I will try it more now that I know there are people who have success.

On Sat, Feb 20, 2010 at 2:45 AM, Stéphane Ducasse <[hidden email]> wrote:
the meta approach

did you try the methodfinder?

open method finder

type

       'Foo Bar Baz' . 5 . 3

-> no single function

       'Foo Bar Baz' . $B . 'Bar'
-> no single function

I stopped but often I find what I want.


On Feb 20, 2010, at 1:05 AM, Nathan Tuttle wrote:

> I can't find any method that allows me to take a substring out of a string my location and length.
>
> Anyone know?
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Substrings for strings?

Marcus Denker-4

On Feb 20, 2010, at 2:39 PM, Nathan Tuttle wrote:

> Often; I don't. I will try it more now that I know there are people who have success.
>


The MethodFinder works for those methods that are registered... it kind of has a black list of known bad methods
and a white list of known good ones, so if you don't add new methods there it will not find it...

(We retained the MethodFinder because we intend to actually make it better at some point..  the idea is cool.. worth to be
generalized and to be taken to a new level)

        Marcus

> On Sat, Feb 20, 2010 at 2:45 AM, Stéphane Ducasse <[hidden email]> wrote:
> the meta approach
>
> did you try the methodfinder?
>
> open method finder
>
> type
>
>        'Foo Bar Baz' . 5 . 3
>
> -> no single function
>
>        'Foo Bar Baz' . $B . 'Bar'
> -> no single function
>
> I stopped but often I find what I want.
>
>
> On Feb 20, 2010, at 1:05 AM, Nathan Tuttle wrote:
>
> > I can't find any method that allows me to take a substring out of a string my location and length.
> >
> > Anyone know?
> > _______________________________________________
> > Pharo-project mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Substrings for strings?

Stéphane Ducasse
Ah yes we should really changes its logic

Stef

On Feb 20, 2010, at 9:15 PM, Marcus Denker wrote:

>
> On Feb 20, 2010, at 2:39 PM, Nathan Tuttle wrote:
>
>> Often; I don't. I will try it more now that I know there are people who have success.
>>
>
>
> The MethodFinder works for those methods that are registered... it kind of has a black list of known bad methods
> and a white list of known good ones, so if you don't add new methods there it will not find it...
>
> (We retained the MethodFinder because we intend to actually make it better at some point..  the idea is cool.. worth to be
> generalized and to be taken to a new level)
>
> Marcus
>
>> On Sat, Feb 20, 2010 at 2:45 AM, Stéphane Ducasse <[hidden email]> wrote:
>> the meta approach
>>
>> did you try the methodfinder?
>>
>> open method finder
>>
>> type
>>
>>       'Foo Bar Baz' . 5 . 3
>>
>> -> no single function
>>
>>       'Foo Bar Baz' . $B . 'Bar'
>> -> no single function
>>
>> I stopped but often I find what I want.
>>
>>
>> On Feb 20, 2010, at 1:05 AM, Nathan Tuttle wrote:
>>
>>> I can't find any method that allows me to take a substring out of a string my location and length.
>>>
>>> Anyone know?
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> --
> Marcus Denker  -- http://www.marcusdenker.de
> INRIA Lille -- Nord Europe. Team RMoD.
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Substrings for strings?

csrabak
I'm not sure if we want to change but rather I feel what we need is to augment it in order other queries can successfully return the method which would do what the person is looking for.

my 0.019999...

--
Cesar Rabak


Em 20/02/2010 20:43, Stéphane Ducasse < [hidden email] > escreveu:
Ah yes we should really changes its logic

Stef

On Feb 20, 2010, at 9:15 PM, Marcus Denker wrote:

>
> On Feb 20, 2010, at 2:39 PM, Nathan Tuttle wrote:
>
>> Often; I don't. I will try it more now that I know there are people who have success.
>>
>
>
> The MethodFinder works for those methods that are registered... it kind of has a black list of known bad methods
> and a white list of known good ones, so if you don't add new methods there it will not find it...
>
> (We retained the MethodFinder because we intend to actually make it better at some point..  the idea is cool.. worth to be
> generalized and to be taken to a new level)
>
> Marcus
>
>> On Sat, Feb 20, 2010 at 2:45 AM, Stéphane Ducasse  wrote:
>> the meta approach
>>
>> did you try the methodfinder?
>>
>> open method finder
>>
>> type
>>
>>       'Foo Bar Baz' . 5 . 3
>>
>> -> no single function
>>
>>       'Foo Bar Baz' . $B . 'Bar'
>> -> no single function
>>
>> I stopped but often I find what I want.
>>
>>
>> On Feb 20, 2010, at 1:05 AM, Nathan Tuttle wrote:
>>
>>> I can't find any method that allows me to take a substring out of a string my location and length.
>>>
>>> Anyone know?
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> --
> Marcus Denker  -- http://www.marcusdenker.de
> INRIA Lille -- Nord Europe. Team RMoD.
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project