Liu Xu
Liu Xu

Reputation: 37

How to remove additional printed line in groovy?

I'm trying to print a string in groovy but the results show an additional empty line below the printed string. Here are my codes:

String strg = "11110111"
println "strg:"+strg

The expected results should be "11110111" but the result has an additional empty line below it. May I know what went wrong and how to solve it? Thanks!

Upvotes: 0

Views: 106

Answers (1)

daggett
daggett

Reputation: 28564

Use print instead of println.

println adds a new line at the end of printed string.

Upvotes: 2

Related Questions