Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Groovy - 31 28 chars

edit thanks to cfrickcfrick's insightful comment:

print args[0].tr("01","10") 

previous:

args[0].each{print it=="1"?0:1} 

Groovy - 31 28 chars

edit thanks to cfrick's insightful comment:

print args[0].tr("01","10") 

previous:

args[0].each{print it=="1"?0:1} 

Groovy - 31 28 chars

edit thanks to cfrick's insightful comment:

print args[0].tr("01","10") 

previous:

args[0].each{print it=="1"?0:1} 
much better thanks
Source Link

Groovy - 3131 28 chars

edit thanks to cfrick's insightful comment:

print args[0].tr("01","10") 

previous:

args[0].each{print it=="1"?0:1} 

Groovy - 31 chars

args[0].each{print it=="1"?0:1} 

Groovy - 31 28 chars

edit thanks to cfrick's insightful comment:

print args[0].tr("01","10") 

previous:

args[0].each{print it=="1"?0:1} 
Source Link

Groovy - 31 chars

args[0].each{print it=="1"?0:1}