From: Ryan Davis Date: 2007-11-21T19:23:09+09:00 Subject: Re: porting java methods to ruby On Nov 21, 2007, at 02:00 , Martin Durai wrote: > Actually the following function has a character array as a return type > > public char[] getTextCharacters(int [] holderForStartAndLength) > { > } Having done far too much of this recently, my guess is it'll look something like: > def get_text_characters > result = [] > > # get the characters and start from whatever... > > return result, start > end I ignored the holderForStartAndLength because the name hints that they are a stupid java hack for not having rich return values. In get_text_characters we don't bother with length because our array (or string... depends on how you actually want to use it) knows it's length and we return the start offset with it. You'd call it like: > chars, offset = get_text_characters