creation string depends of variables

J

Junyoung Kim

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?
 
D

Damjan Rems

junyoung said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,274
Messages
2,571,366
Members
48,055
Latest member
RacheleCar

Latest Threads

Top