Groovy web console

subscribe to the feed Subscribe
to this
site
test (via #groovywebconsole)
tweet this snippet Tweet
this
script

test

Published 11 months ago by me
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def l1 = ['en', 'de', 'hu'] //supportedLocales.language
def l2 = ['en', 'de'] //deviceLanguage
def l3 = ['ro'] //let's say no common language
def l4 = [] //another case

def common = l1.intersect(l2)
def common2 = l1.intersect(l3)
def common3 = l1.intersect(l4)

println common
println common2
println common3