frogEye
frogEye

Reputation: 364

Concatenation of string and int value in nim

I want to concatenate string and int. But it doesn't work with & and add operator.

echo "abc" & 2

But it doesn't work.

Upvotes: 8

Views: 2796

Answers (1)

uran
uran

Reputation: 1336

There's an operator $ that converts something to string.

echo "abc" & $2
echo "abc", 2 # echo automatically applies `$` to its arguments

Upvotes: 15

Related Questions