Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Operators with String : str1 contains str2 ?
Operators with String : str1 contains str2 ? [message #714319] Wed, 10 August 2011 10:06 Go to next message
AmenieV  is currently offline AmenieV Friend
Messages: 13
Registered: June 2011
Junior Member
Hi,

I have too strings str1 et str2 and I want to know if str1 contains str2 !
How can I write this instruction with OCL?

What I saw in the different courses of OCL,there are just :
size()
concat(String)
toUpper()
toLower()
substring(Entier, Entier) as operators for String..

I tried with 'endswith' in interactiveOCL and ,exactly,it displays me an error.
So What should I do?

Thankx,
Regards
(no subject) [message #714487 is a reply to message #714319] Wed, 10 August 2011 16:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Try String::indexOf(String)

Regards

Ed Willink

On 10/08/2011 11:06, AmenieV wrote:
> Hi,
>
> I have too strings str1 et str2 and I want to know if str1 contains
> str2 ! How can I write this instruction with OCL?
>
> What I saw in the different courses of OCL,there are just :
> size() concat(String) toUpper() toLower()
> substring(Entier, Entier) as operators for String..
>
> I tried with 'endswith' in interactiveOCL and ,exactly,it displays me
> an error. So What should I do?
>
> Thankx,
> Regards
Re: (no subject) [message #714738 is a reply to message #714487] Thu, 11 August 2011 12:13 Go to previous message
AmenieV  is currently offline AmenieV Friend
Messages: 13
Registered: June 2011
Junior Member
Thanks a lot Ed ..
Previous Topic:index in a collection
Next Topic:Definion of variables inOclInEcore
Goto Forum:
  


Current Time: Wed Apr 24 18:51:06 GMT 2024

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

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

Back to the top