Is there a more concise way to write this?

a = 5

b = “test123”

if a < b.length

a = b.length

end

–or–

a = b.length if a < b.length

Earle

Is there a more concise way to write this?

a = 5

b = “test123”

if a < b.length

a = b.length

end

–or–

a = b.length if a < b.length

Earle

Ball, Donald A Jr (Library) wrote:

a = b.length if a < b.length

a = [a, b.length].max

- donald

Excellent. Thanks.

Earle