lista = ['01.um', '02.dois', '03.tres'] for(i = 0; i < lista.size(); i++) lista[i] = lista[i].tokenize('.')[0] println lista
Standard input is empty
[01, 02, 03]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!