SLua學習紀錄,字串連結

SLua字串連結使用方法

SLua 字串與整數值連結

function sum(b)
    local s = 5
    
    s = s + b
    
    return b.."+"..s
end

或者需要print出來

function sum(b)
    local s = 5
    
    s = s + b
    
    print(b.."+"..s)
    
    return s
end

但是如果是bool值 就要改成以下作法

print("Print Log", bool)

不然會報以下錯誤

或是只print 出bool值 前面文字不會印出來