Skip to main content



      Home
Home » Modeling » OCL » count words or spaces in a string
count words or spaces in a string [message #560141] Tue, 21 September 2010 06:36
Eclipse UserFriend
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: Sat Jul 12 23:37:13 EDT 2025

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

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

Back to the top