Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » isSubstringOf?
isSubstringOf? [message #479223] Mon, 10 August 2009 10:28 Go to next message
Eclipse UserFriend
Originally posted by: d.clowes.lboro.ac.uk

I am understanding this operation correctly or is there a bug?

If I do 'J.0E1'.isSubstringOf('E').println(); I get false when I'm
expecting true as 'E' is a substring of tEst.

Am I doing something wrong? has anyone else used this operation?
Re: isSubstringOf? [message #479226 is a reply to message #479223] Mon, 10 August 2009 10:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: d.clowes.lboro.ac.uk

I am instead using the matches('.*E.*') operation instead. Still worth
finding out if my understanding of isSubstringOf() is wrong.

Darren
Re: isSubstringOf? [message #479251 is a reply to message #479223] Mon, 10 August 2009 12:42 Go to previous messageGo to next message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Darren Clowes wrote:
> I am understanding this operation correctly or is there a bug?
>
> If I do 'J.0E1'.isSubstringOf('E').println(); I get false when I'm
> expecting true as 'E' is a substring of tEst.
>
> Am I doing something wrong? has anyone else used this operation?
>

Darren,

The isSubstringOf expression can feel a little unnatural. It's actually
called *on* the (possible) substring. In the context of your example:

'J.0E1'.isSubstringOf('E') -- returns false, J.0E1 is not a substring of E

'E'.isSubstringOf('J.0E1') -- returns true, E is a substring of J.0E1

Cheers,
Louis.
Re: isSubstringOf? [message #479281 is a reply to message #479251] Mon, 10 August 2009 14:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: d.clowes.lboro.ac.uk

Louis Rose wrote:

> The isSubstringOf expression can feel a little unnatural. It's actually
> called *on* the (possible) substring. In the context of your example:

> 'J.0E1'.isSubstringOf('E') -- returns false, J.0E1 is not a substring of E

> 'E'.isSubstringOf('J.0E1') -- returns true, E is a substring of J.0E1

> Cheers,
> Louis.
Thanks Louis,

It just seems opposite to what the book says:

isSubstringOf(str : String) :
Boolean

Returns true iff str is a sub-string of
the string the operation is invoked
on
Re: isSubstringOf? [message #479330 is a reply to message #479281] Mon, 10 August 2009 17:13 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Darren Clowes wrote:
> Louis Rose wrote:
>
>> The isSubstringOf expression can feel a little unnatural. It's
>> actually called *on* the (possible) substring. In the context of your
>> example:
>
>> 'J.0E1'.isSubstringOf('E') -- returns false, J.0E1 is not a substring
>> of E
>
>> 'E'.isSubstringOf('J.0E1') -- returns true, E is a substring of J.0E1
>
>> Cheers,
>> Louis.
> Thanks Louis,
>
> It just seems opposite to what the book says:
>
> isSubstringOf(str : String) :
> Boolean
>
> Returns true iff str is a sub-string of
> the string the operation is invoked
> on
>

You're right! Looks like a typo - I've fixed the description now.

Apologies for the misinformation, but thanks for finding it!

Cheers,
Louis.
Re: isSubstringOf? [message #573341 is a reply to message #479223] Mon, 10 August 2009 10:53 Go to previous message
Darren  is currently offline Darren Friend
Messages: 40
Registered: September 2009
Member
I am instead using the matches('.*E.*') operation instead. Still worth
finding out if my understanding of isSubstringOf() is wrong.

Darren
Re: isSubstringOf? [message #573368 is a reply to message #479223] Mon, 10 August 2009 12:42 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Darren Clowes wrote:
> I am understanding this operation correctly or is there a bug?
>
> If I do 'J.0E1'.isSubstringOf('E').println(); I get false when I'm
> expecting true as 'E' is a substring of tEst.
>
> Am I doing something wrong? has anyone else used this operation?
>

Darren,

The isSubstringOf expression can feel a little unnatural. It's actually
called *on* the (possible) substring. In the context of your example:

'J.0E1'.isSubstringOf('E') -- returns false, J.0E1 is not a substring of E

'E'.isSubstringOf('J.0E1') -- returns true, E is a substring of J.0E1

Cheers,
Louis.
Re: isSubstringOf? [message #573390 is a reply to message #479251] Mon, 10 August 2009 14:16 Go to previous message
Darren  is currently offline Darren Friend
Messages: 40
Registered: September 2009
Member
Louis Rose wrote:

> The isSubstringOf expression can feel a little unnatural. It's actually
> called *on* the (possible) substring. In the context of your example:

> 'J.0E1'.isSubstringOf('E') -- returns false, J.0E1 is not a substring of E

> 'E'.isSubstringOf('J.0E1') -- returns true, E is a substring of J.0E1

> Cheers,
> Louis.
Thanks Louis,

It just seems opposite to what the book says:

isSubstringOf(str : String) :
Boolean

Returns true iff str is a sub-string of
the string the operation is invoked
on
Re: isSubstringOf? [message #573450 is a reply to message #479281] Mon, 10 August 2009 17:13 Go to previous message
Louis Rose is currently offline Louis RoseFriend
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Darren Clowes wrote:
> Louis Rose wrote:
>
>> The isSubstringOf expression can feel a little unnatural. It's
>> actually called *on* the (possible) substring. In the context of your
>> example:
>
>> 'J.0E1'.isSubstringOf('E') -- returns false, J.0E1 is not a substring
>> of E
>
>> 'E'.isSubstringOf('J.0E1') -- returns true, E is a substring of J.0E1
>
>> Cheers,
>> Louis.
> Thanks Louis,
>
> It just seems opposite to what the book says:
>
> isSubstringOf(str : String) :
> Boolean
>
> Returns true iff str is a sub-string of
> the string the operation is invoked
> on
>

You're right! Looks like a typo - I've fixed the description now.

Apologies for the misinformation, but thanks for finding it!

Cheers,
Louis.
Previous Topic:EVL fix guards marked as errors?
Next Topic:EVL fix guards marked as errors?
Goto Forum:
  


Current Time: Fri Apr 26 20:50:09 GMT 2024

Powered by FUDForum. Page generated in 0.03808 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top