|[Acceleo]Inverting a String [message #1232472]
||Fri, 17 January 2014 02:09
| michel souza
Registered: December 2013
Hi guys.. I know this is supposed to be a simple action do a kind of reverse but I'm kinda lost.|
1- I've tried to find a method that would do that directly to me... but I haven't found
2- I thought to break a string in a token and access from the last to the first element. I don't know how in Acceleo.
In fact, I found out that Sequence and OrderedSet have a method called reverse() that would help me. But I try to break the string in tokens using mystring.tokenize('.'). This method was supposed to return a Sequence.... but this doesn't happen.. it returns instead a Bag... ok.. I tried to mybag->asSequence()->reverse().. but turning a bag into a sequence is messing with the order.
So if you have any idea.. I would really appreciate.
I want to turn "http://example.com" into "com.example"
[Updated on: Fri, 17 January 2014 02:10]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02536 seconds