Given an array of n Objects, let\'s say it is an array of strings, and it has the following values:
foo[0] = \"a\";
foo[1]
In an array of Strings like
String name = 'a b c d e a f b d e' // could be like String name = 'aa bb c d e aa f bb d e'
I build the following class
class clearname{
def parts
def tv
public def str = ''
String name
clearname(String name){
this.name = name
this.parts = this.name.split(" ")
this.tv = this.parts.size()
}
public String cleared(){
int i
int k
int j=0
for(i=0;i
getting this result
a b c d e f
hope this code help anyone Regards