Best way for two dimensional array iteration

36 views
Skip to first unread message

Alexander Zimin

unread,
Jun 4, 2015, 11:35:38 AM6/4/15
to ceylon...@googlegroups.com
Hello all,

I am looking for most convenient way to iterate two-dimensional array [[String*]*] x.
In C language I would use two loops and just x[i][j] to get an element.

Does Ceylon have something similar?

Stephane Epardaud

unread,
Jun 4, 2015, 11:36:46 AM6/4/15
to ceylon...@googlegroups.com
Try:

function([[String*]*] x){
 for(line in x){
  for(elem in line){
   print(elem);
  }
 }
}

--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at http://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/a6d6028e-9723-4af3-b597-ddf053338ce0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud
Reply all
Reply to author
Forward
0 new messages