Creation string depends of variables

I wanna create a full string depends on some variables.

let me give example.

def sayOddOrNot(aNum)
sFullStr = << END_OF_FULL_STR
the num is SOMETHING(ODD OR NOT)
END_FULL_STR
end

how can I complete a full string depends of aNum variable in a string?

junyoung kim wrote:

I wanna create a full string depends on some variables.

let me give example.

def sayOddOrNot(aNum)
sFullStr = << END_OF_FULL_STR
the num is SOMETHING(ODD OR NOT)
END_FULL_STR
end

how can I complete a full string depends of aNum variable in a string?

def sayOddOrNot(aNum)
sFullStr = << END_OF_FULL_STR
the num is #{SOMETHING(ODD OR NOT)}
#{aNum}
#{aNum == 5 ? ‘Yes’ : ‘No’}
END_FULL_STR
end

If I understood it right.

by
TheR

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs