Code:
class GroovyController {
def messageSource
def index(){
def array1 = [1,2,3,4,5]
def array2 = [3,4]
println 'Intersection of array1 and array2 : '+array1.intersect(array2)
render ''
}
}
Output:
Intersection of array1 and array2 : [3, 4]
class GroovyController {
def messageSource
def index(){
def array1 = [1,2,3,4,5]
def array2 = [3,4]
println 'Intersection of array1 and array2 : '+array1.intersect(array2)
render ''
}
}
Output:
Intersection of array1 and array2 : [3, 4]
No comments:
Post a Comment