Anyone have an implementation of upTo: aString for use with either a string or stream?

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

Anyone have an implementation of upTo: aString for use with either a string or stream?

Rick Flower
I figured I'd ask before I roll my own.. I'm looking for something
that will really be used with streams and will stop when the
specified string is found.. If it doesn't exist then I'll gen one
up.. Thx!
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Anyone have an implementation of upTo: aString for use with either a string or stream?

Dave Stevenson-3
You mean like PositionableStream>>upToAll:?
 
Dave Stevenson
[hidden email]



From: Rick Flower <[hidden email]>
To: [hidden email]
Sent: Wed, May 19, 2010 2:19:48 PM
Subject: [vwnc] Anyone have an implementation of upTo: aString for use with either a string or stream?

I figured I'd ask before I roll my own.. I'm looking for something
that will really be used with streams and will stop when the
specified string is found.. If it doesn't exist then I'll gen one
up.. Thx!
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Anyone have an implementation of upTo: aString for use with either a string or stream?

Rick Flower
Hmm.. That might just work.. Thx!!

On Wed, 19 May 2010 14:35:56 -0700 (PDT), Dave Stevenson
<[hidden email]> wrote:

> You mean like PositionableStream>>upToAll:?
>  Dave Stevenson
> [hidden email]
>
>
>
>
> ________________________________
> From: Rick Flower <[hidden email]>
> To: [hidden email]
> Sent: Wed, May 19, 2010 2:19:48 PM
> Subject: [vwnc] Anyone have an implementation of upTo: aString for use
> with either a string or stream?
>
> I figured I'd ask before I roll my own.. I'm looking for something
> that will really be used with streams and will stop when the
> specified string is found.. If it doesn't exist then I'll gen one
> up.. Thx!
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Anyone have an implementation of upTo: aString for use with either a string or stream?

Steven Kelly
In reply to this post by Rick Flower
Re: [vwnc] Anyone have an implementation of upTo: aString for use with either a string or stream?
But note the gotcha: upTo: leaves the position AFTER the search argument, upToAll: leaves the position BEFORE the search argument. I've often wondered about this difference (copyReplaceAll: 'wondered' with: 'cursed volubly' :->)
 
Using upToAndSkipThroughAll: will give you the familiar 'AFTER' behaviour.
 
Cheers,
Steve


From: [hidden email] on behalf of Rick Flower
Sent: Thu 20/05/2010 00:40
To: Dave Stevenson
Cc: [hidden email]
Subject: Re: [vwnc] Anyone have an implementation of upTo: aString for use with either a string or stream?

Hmm.. That might just work.. Thx!!

On Wed, 19 May 2010 14:35:56 -0700 (PDT), Dave Stevenson
<[hidden email]> wrote:


> You mean like PositionableStream>>upToAll:?
>  Dave Stevenson
> [hidden email]
>
>
>
>
> ________________________________
> From: Rick Flower <[hidden email]>
> To: [hidden email]
> Sent: Wed, May 19, 2010 2:19:48 PM
> Subject: [vwnc] Anyone have an implementation of upTo: aString for use
> with either a string or stream?
>
> I figured I'd ask before I roll my own.. I'm looking for something
> that will really be used with streams and will stop when the
> specified string is found.. If it doesn't exist then I'll gen one
> up.. Thx!
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Anyone have an implementation of upTo: aString for use with either a string or stream?

Rick Flower
On Thu, 20 May 2010 01:59:20 +0300, "Steven Kelly" <[hidden email]>
wrote:
> But note the gotcha: upTo: leaves the position AFTER the search
argument,
> upToAll: leaves the position BEFORE the search argument. I've often
> wondered about this difference (copyReplaceAll: 'wondered' with: 'cursed
> volubly' :->)
>  
> Using upToAndSkipThroughAll: will give you the familiar 'AFTER'
behaviour.

Actually in my case I'd prefer the 'BEFORE' behavior as it fits right in
with my existing logic.. :)
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc