Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » count words or spaces in a string
count words or spaces in a string [message #560141] Tue, 21 September 2010 10:36
pkojo is currently offline pkojoFriend
Messages: 27
Registered: October 2009
Junior Member
Hi,

I am interested to write a query to check how many words are used for the name of any classifier in OCL ( eclipse interpreter console).
to make it simple, count number of words used for a class name.

self.name took complete name as a one string.
To look for each character in the string it looks that substring function might work, for example third element in a string is a space. But substring took upper and lower values as an integer value. I want to make this a general query becuase I do not know how many words are used as a class name or after how many characters the next word starts.

Set{' '}->includes(self.name.substring(1,3))

is there any way to define this as general query.

Thanks in advance,
pkojo

Previous Topic:[OCLinEcore] definition of operation works in OCL console, but not in other modules like Acceleo
Next Topic:definitions in OCL?
Goto Forum:
  


Current Time: Thu Nov 27 00:40:49 GMT 2014

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

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