GScript > Java (pt 2)

Sometimes you need to get the last element in an array. Here is how you do it in java:

  String lastString = myStrings[ myStrings.length - 1 ];

Here is how you do it in GScript:

  var lastString = myStrings.last()

It is a small thing, but enough small things make a big thing.


One Comment on “GScript > Java (pt 2)”

  1. Scott McKinney says:

    Nice. But it would be even better as a property:

    myStrings.Last

    It is a smaller thing, but enough smaller things make a small thing 😉


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s