syntax error, unexpected (arg, expecting end-of-input)

1

I came across this syntax error:

  

syntax error, unexpected (arg, expecting end-of-input)

larguraDaLinha = 40
str = '--> text <--'
puts str.ljust  larguraDaLinha
puts str.center larguraDaLinha
puts str.rjust  larguraDaLinha
puts str.ljust (larguraDaLinha/2) + str.rjust (larguraDaLinha/2)

link

    
asked by anonymous 10.09.2017 / 00:13

1 answer

1

Missing calls in the function calls. Try to keep the code organized and within a standard, so avoid errors like this.

larguraDaLinha = 40
str = '--> text <--'
puts str.ljust(larguraDaLinha)
puts str.center(larguraDaLinha)
puts str.rjust(larguraDaLinha)
puts str.ljust(larguraDaLinha/2) + str.rjust(larguraDaLinha/2)

See running on ideone . And on Coding Ground . Also put it in GitHub for future reference .

    
10.09.2017 / 00:15