|Re: Converting Integer to String [message #489598 is a reply to message #489564]
||Mon, 05 October 2009 08:34
Originally posted by: dvorak.radek.gmail.com|
The QVTO Stdlib defines Integer::toString() operation. The OMG spec does
Object::repr() : String
Prints a textual representation of the object.
Very informative about what to expect ;-)
We have included it to address backward compatibility issues and also
because the 09-05-02 OCL OMG spec draft adds this to the OCL Stdlib.
You can write your snippet like
var someNumber := 15;
var somePrefix := "pre_";
var concat := somePrefix + someNumber.toString();
On Mon, 05 Oct 2009 01:51:52 +0200, Derek Palma <email@example.com>
> Is there a way to convert an Integer to a String? I am trying to get a
> statement like 'Some Prefix: '.concat(someNumber) where some number is
> an Integer. I could not find anything in the OCL spec that made me think
> this was possible (looking at Integer, Real and OclAny). However, I am
> assuming I missed it since most languages seem to have such a feature.
> Thanks in advance.
Powered by FUDForum
. Page generated in 0.07305 seconds