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 Response

  1. 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